Chapter 4 Build (Configuration) Options

The following tables details all of the configuration options available when building MySQL server from source. The first table shows the CMake options, which are used in MySQL 5.5.5 and up. The second table shows the configure (GNU autotools) options, which are used prior to MySQL 5.5.5. The tables includes the following columns:

Table 4.1 Build (CMake) options

NameDescription
DefaultIntroducedRemoved5.55.65.7
BUILD_CONFIGUse same build options as official releases
 5.5.7 YesYesYes
CMAKE_BUILD_TYPEType of build to produce
RelWithDebInfo5.5.7 YesYesYes
CMAKE_CXX_FLAGSFlags for C++ Compiler
   YesYesYes
CMAKE_C_FLAGSFlags for C Compiler
   YesYesYes
CMAKE_INSTALL_PREFIXInstallation base directory
/usr/local/mysql5.5.8 YesYesYes
COMPILATION_COMMENTComment about compilation environment
 5.5.7 YesYesYes
CPACK_MONOLITHIC_INSTALLWhether package build produces single file
OFF5.5.7 YesYesYes
DEFAULT_CHARSETThe default server character set
latin15.5.7 YesYesYes
DEFAULT_COLLATIONThe default server collation
latin1_swedish_ci5.5.7 YesYesYes
DISABLE_PSI_CONDExclude Performance Schema condition instrumentation
OFF5.7.3   Yes
DISABLE_PSI_FILEExclude Performance Schema file instrumentation
OFF5.7.3   Yes
DISABLE_PSI_IDLEExclude Performance Schema idle instrumentation
OFF5.7.3   Yes
DISABLE_PSI_MEMORYExclude Performance Schema memory instrumentation
OFF5.7.3   Yes
DISABLE_PSI_METADATAExclude Performance Schema metadata instrumentation
OFF5.7.3   Yes
DISABLE_PSI_MUTEXExclude Performance Schema mutex instrumentation
OFF5.7.3   Yes
DISABLE_PSI_RWLOCKExclude Performance Schema rwlock instrumentation
OFF5.7.3   Yes
DISABLE_PSI_SOCKETExclude Performance Schema socket instrumentation
OFF5.7.3   Yes
DISABLE_PSI_SPExclude Performance Schema stored program instrumentation
OFF5.7.3   Yes
DISABLE_PSI_STAGEExclude Performance Schema stage instrumentation
OFF5.7.3   Yes
DISABLE_PSI_STATEMENTExclude Performance Schema statement instrumentation
OFF5.7.3   Yes
DISABLE_PSI_STATEMENT_DIGESTExclude Performance Schema statement_digest instrumentation
OFF5.7.3   Yes
DISABLE_PSI_TABLEExclude Performance Schema table instrumentation
OFF5.7.3   Yes
DOWNLOAD_BOOSTWhether to download the Boost library
OFF5.7.5   Yes
DOWNLOAD_BOOST_TIMEOUTTimeout in seconds for downloading the Boost library
6005.7.6   Yes
-DWITH_SYMVER16Whether libmysqlclient.so.18 contains both symver 16 and 18 symbols.
OFF5.6.31  Yes 
ENABLED_LOCAL_INFILEWhether to enable LOCAL for LOAD DATA INFILE
OFF5.5.7 YesYesYes
ENABLED_PROFILINGWhether to enable query profiling code
ON5.5.7 YesYesYes
ENABLE_DEBUG_SYNCWhether to enable Debug Sync support
ON5.5.7 YesYesYes
ENABLE_DOWNLOADSWhether to download optional files
OFF5.5.7 YesYesYes
ENABLE_DTRACEWhether to include DTrace support
 5.5.7 YesYesYes
ENABLE_GCOVWhether to include gcov support
 5.5.14, 5.6.3 YesYesYes
ENABLE_GPROFEnable gprof (optimized Linux builds only)
OFF5.6.6  YesYes
FORCE_UNSUPPORTED_COMPILERWhether to permit unsupported compiler
OFF5.7.5   Yes
IGNORE_AIO_CHECKWith -DBUILD_CONFIG=mysql_release, ignore libaio check
OFF5.5.9, 5.6.1 YesYesYes
INNODB_PAGE_ATOMIC_REF_COUNTEnable or disable atomic page reference counting
ON5.6.16, 5.7.45.7.5 YesYes
INSTALL_BINDIRUser executables directory
PREFIX/bin5.5.7 YesYesYes
INSTALL_DOCDIRDocumentation directory
PREFIX/docs5.5.7 YesYesYes
INSTALL_DOCREADMEDIRREADME file directory
PREFIX5.5.7 YesYesYes
INSTALL_INCLUDEDIRHeader file directory
PREFIX/include5.5.7 YesYesYes
INSTALL_INFODIRInfo file directory
PREFIX/docs5.5.7 YesYesYes
INSTALL_LAYOUTSelect predefined installation layout
STANDALONE5.5.7 YesYesYes
INSTALL_LIBDIRLibrary file directory
PREFIX/lib5.5.7 YesYesYes
INSTALL_MANDIRManual page directory
PREFIX/man5.5.7 YesYesYes
INSTALL_MYSQLKEYRINGDIRDirectory for keyring_file plugin data file
platform specific5.7.11   Yes
INSTALL_MYSQLSHAREDIRShared data directory
PREFIX/share5.5.7 YesYesYes
INSTALL_MYSQLTESTDIRmysql-test directory
PREFIX/mysql-test5.5.7 YesYesYes
INSTALL_PKGCONFIGDIRDirectory for mysqlclient.pc pkg-config file
INSTALL_LIBDIR/pkgconfig5.7.9   Yes
INSTALL_PLUGINDIRPlugin directory
PREFIX/lib/plugin5.5.7 YesYesYes
INSTALL_SBINDIRServer executable directory
PREFIX/bin5.5.7 YesYesYes
INSTALL_SCRIPTDIRScripts directory
PREFIX/scripts5.5.7 YesYesYes
INSTALL_SECURE_FILE_PRIVDIRsecure_file_priv default value
platform specific5.7.6   Yes
INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIRsecure_file_priv default value for libmysqld
 5.7.8   Yes
INSTALL_SHAREDIRaclocal/mysql.m4 installation directory
PREFIX/share5.5.7 YesYesYes
INSTALL_SQLBENCHDIRsql-bench directory
PREFIX5.5.75.7.8YesYesYes
INSTALL_SUPPORTFILESDIRExtra support files directory
PREFIX/support-files5.5.7 YesYesYes
MAX_INDEXESMaximum indexes per table
645.7.1   Yes
MEMCACHED_HOMEPath to memcached
[none]5.5.16-ndb-7.2.2 YesYes 
MUTEX_TYPEInnoDB mutex type
event5.7.2   Yes
MYSQL_DATADIRData directory
 5.5.7 YesYesYes
MYSQL_MAINTAINER_MODEWhether to enable MySQL maintainer-specific development environment
OFF5.5.7 YesYesYes
MYSQL_PROJECT_NAMEWindows/OS X project name
33065.5.21, 5.6.5 YesYesYes
MYSQL_TCP_PORTTCP/IP port number
33065.5.7 YesYesYes
MYSQL_UNIX_ADDRUnix socket file
/tmp/mysql.sock5.5.7 YesYesYes
ODBC_INCLUDESODBC includes directory
   YesYesYes
ODBC_LIB_DIRODBC library directory
   YesYesYes
OPTIMIZER_TRACEWhether to support optimizer tracing
 5.6.3  YesYes
SUNPRO_CXX_LIBRARYClient link library on Solaris 10+
 5.6.20, 5.7.5  YesYes
SYSCONFDIROption file directory
 5.5.7 YesYesYes
SYSTEMD_PID_DIRDirectory for PID file under systemd
/var/run/mysqld5.7.6   Yes
SYSTEMD_SERVICE_NAMEName of MySQL service under systemd
mysqld5.7.6   Yes
TMPDIRtmpdir default value
 5.5.36, 5.6.16, 5.7.4 YesYesYes
WIN_DEBUG_NO_INLINEWhether to disable function inlining
OFF5.7.6   Yes
WITHOUT_SERVERDo not build the server
OFF  YesYesYes
WITHOUT_xxx_STORAGE_ENGINEExclude storage engine xxx from build
 5.5.7 YesYesYes
WITH_ASANEnable AddressSanitizer
OFF5.5.35, 5.6.15, 5.7.3 YesYesYes
WITH_AUTHENTICATION_PAMBuild PAM authentication plugin
OFF    Yes
WITH_BOOSTThe location of the Boost library sources
 5.7.5   Yes
WITH_BUNDLED_LIBEVENTUse bundled libevent when building ndbmemcache
ON5.5.16-ndb-7.2.2 YesYes 
WITH_BUNDLED_MEMCACHEDUse bundled memcached when building ndbmemcache
ON5.5.16-ndb-7.2.2 YesYes 
WITH_CLASSPATHClasspath to use when building MySQL Cluster Connector for Java. Default is an empty string.
  YesYes 
WITH_CLIENT_PROTOCOL_TRACINGBuild client-side protocol tracing framework
ON5.7.2   Yes
WITH_DEBUGWhether to include debugging support
OFF5.5.7 YesYesYes
WITH_DEFAULT_COMPILER_OPTIONSWhether to use default compiler options
ON5.6.6  YesYes
WITH_DEFAULT_FEATURE_SETWhether to use default feature set
ON5.6.6  YesYes
WITH_EDITLINEWhich libedit/editline library to use
bundled5.6.12, 5.7.2  YesYes
WITH_EMBEDDED_SERVERWhether to build embedded server
OFF5.5.7 YesYesYes
WITH_EMBEDDED_SHARED_LIBRARYWhether to build a shared embedded server library
OFF5.5.37, 5.6.17, 5.7.4 YesYesYes
WITH_ERROR_INSERTEnable error injection in the NDB storage engine. Should not be used for building binaries intended for production.
OFF  YesYes 
WITH_EXTRA_CHARSETSWhich extra character sets to include
all5.5.7 YesYesYes
WITH_INNODB_EXTRA_DEBUGWhether to include extra debugging support for InnoDB.
OFF5.7.2   Yes
WITH_INNODB_MEMCACHEDWhether to generate memcached shared libraries.
OFF   YesYes
WITH_KEYRING_TESTBuild the keyring test program
OFF5.7.11   Yes
WITH_LIBEDITUse bundled libedit library
ON5.5.75.6.12YesYes 
WITH_LIBEVENTWhich libevent library to use
bundled5.6.6  YesYes
WITH_LIBWRAPWhether to include libwrap (TCP wrappers) support
OFF5.5.7 YesYesYes
WITH_MECABCompiles MeCab
 5.7.6   Yes
WITH_MSANEnable MemorySanitizer
OFF5.7.4   Yes
WITH_MSCRT_DEBUGEnable Visual Studio CRT memory leak tracing
OFF5.7.6   Yes
WITH_NDBCLUSTERBuild the NDB storage engine; alias for WITH_NDBCLUSTER_STORAGE_ENGINE
ON  YesYesYes
WITH_NDBCLUSTER_STORAGE_ENGINEBuild the NDB storage engine
ON  YesYesYes
WITH_NDBMTDBuild multi-threaded data node.
ON  YesYes 
WITH_NDB_BINLOGEnable binary logging by default by mysqld.
ON  YesYes 
WITH_NDB_DEBUGProduce a debug build for testing or troubleshooting.
OFF  YesYes 
WITH_NDB_JAVAEnable building of Java and ClusterJ support. Enabled by default. Supported in MySQL Cluster only.
ON5.5.27-ndb-7.2.9 YesYes 
WITH_NDB_PORTDefault port used by a management server built with this option. If this option was not used to build it, the management server's default port is 1186.
[none]  YesYes 
WITH_NDB_TESTInclude NDB API test programs.
OFF  YesYes 
WITH_RAPIDWhether to build rapid development cycle plugins
ON5.7.12   Yes
WITH_READLINEUse bundled readline library
OFF5.5.75.6.5YesYes 
WITH_SSLType of SSL support
bundled5.5.7 YesYesYes
WITH_SYSTEMDEnable installation of systemd support files
OFF5.7.6   Yes
WITH_TEST_TRACE_PLUGINBuild test protocol trace plugin
OFF5.7.2   Yes
WITH_UBSANEnable Undefined Behavior Sanitizer
OFF5.7.6   Yes
WITH_UNIXODBCEnable unixODBC support
OFF  YesYesYes
WITH_VALGRINDWhether to compile in Valgrind header files
OFF5.5.6 YesYesYes
WITH_ZLIBType of zlib support
bundled5.5.7 YesYesYes
WITH_xxx_STORAGE_ENGINECompile storage engine xxx statically into server
 5.5.7 YesYesYes

Table 4.2 Build (configure) options

NameDescription
DefaultIntroducedRemoved5.1
--bindirUser executables
EPREFIX/bin  Yes
--buildConfigure for building on BUILD
guessed  Yes
--cache-fileCache test results in FILE
disabled  Yes
--config-cacheAlias for `--cache-file=config.cache'
   Yes
--datadirRead-only architecture-independent data
PREFIX/share  Yes
--disable-FEATUREDo not include FEATURE
   Yes
--disable-community-featuresDisable additional features provided by the community
 5.1.28 Yes
--disable-dependency-trackingDisable dependency tracking
   Yes
--disable-grant-optionsDisable GRANT options
   Yes
--disable-largefileOmit support for large files
   Yes
--disable-libtool-lockDisable libtool lock
   Yes
--disable-thread-safe-clientCompile the client without threads
 5.1.7 Yes
--enable-FEATUREEnable FEATURE
   Yes
--enable-assemblerUse assembler versions of some string functions if available
   Yes
--enable-debug-syncCompile in Debug Sync facility
 5.1.41 Yes
--enable-dependency-trackingDo not reject slow dependency extractors
   Yes
--enable-fast-installOptimize for fast installation
yes  Yes
--enable-local-infileEnable LOCAL for LOAD DATA INFILE
disabled  Yes
--enable-profilingBuild a version with query profiling code
 5.1.24 Yes
--enable-sharedBuild shared libraries
yes  Yes
--enable-staticBuild static libraries
yes  Yes
--enable-thread-safe-clientCompile the client with threads
  5.1.6Yes
--exec-prefixInstall architecture-dependent files in EPREFIX
   Yes
--helpDisplay help message and exit
   Yes
--hostCross-compile to build programs to run on HOST
   Yes
--includedirC header files
PREFIX/include  Yes
--infodirInfo documentation
PREFIX/info  Yes
--libdirObject code libraries
EPREFIX/lib  Yes
--libexecdirProgram executables
EPREFIX/libexec  Yes
--localstatedirModifiable single-machine data
PREFIX/var  Yes
--mandirman documentation
PREFIX/man  Yes
--no-createDo not create output files
   Yes
--oldincludedirC header files for non-gcc
/usr/include  Yes
--prefixInstall architecture-independent files in PREFIX
   Yes
--program-prefixPrepend PREFIX to installed program names
   Yes
--program-suffixAppend SUFFIX to installed program names
   Yes
--program-transform-namerun sed PROGRAM on installed program names
   Yes
--quietDo not print `checking...' messages
   Yes
--sbindirSystem administrative executables
EPREFIX/sbin  Yes
--sharedstatedirModifiable architecture-independent data
PREFIX/com  Yes
--srcdirFind the sources in DIR
configure directory or ..  Yes
--sysconfdirRead-only single-machine data
PREFIX/etc  Yes
--targetConfigure for building compilers for TARGET
   Yes
--versionDisplay version information and exit
   Yes
--with-PACKAGEUse PACKAGE
   Yes
--with-archive-storage-engineEnable the Archive Storage Engine
no 5.1.9Yes
--with-atomic-opsImplement atomic operations using pthread rwlocks or atomic CPU instructions for multi-processor
 5.1.12 Yes
--with-berkeley-dbUse BerkeleyDB located in DIR
no 5.1.11Yes
--with-berkeley-db-includesFind Berkeley DB headers in DIR
  5.1.11Yes
--with-berkeley-db-libsFind Berkeley DB libraries in DIR
  5.1.11Yes
--with-big-tablesSupport tables with more than 4 G rows even on 32 bit platforms
   Yes
--with-blackhole-storage-engineEnable the Blackhole Storage Engine
no 5.1.9Yes
--with-charsetDefault character set
   Yes
--with-client-ldflagsExtra linking arguments for clients
   Yes
--with-collationDefault collation
   Yes
--with-commentComment about compilation environment
   Yes
--with-csv-storage-engineEnable the CSV Storage Engine
yes 5.1.9Yes
--with-darwin-mwccUse Metrowerks CodeWarrior wrappers on OS X/Darwin
   Yes
--with-debugAdd debug code (optionally with memory checker, very slow)
 5.1.7 Yes
--with-embedded-privilege-controlBuild parts to check user's privileges (only affects embedded library)
   Yes
--with-embedded-serverBuild the embedded server
   Yes
--with-error-injectEnable error injection in MySQL Server
 5.1.11 Yes
--with-example-storage-engineEnable the Example Storage Engine
no 5.1.9Yes
--with-extra-charsetsUse charsets in addition to default
   Yes
--with-fast-mutexesCompile with fast mutexes
disabled5.1.5 Yes
--with-federated-storage-engineEnable federated storage engine
no5.1.35.1.9Yes
--with-gnu-ldAssume the C compiler uses GNU ld
no  Yes
--with-innodbEnable innobase storage engine
no5.1.35.1.9Yes
--with-lib-ccflagsExtra CC options for libraries
   Yes
--with-libwrapCompile in libwrap (tcp_wrappers) support
   Yes
--with-low-memoryTry to use less memory to compile to avoid memory limitations
   Yes
--with-machine-typeSet the machine type, like "powerpc"
   Yes
--with-maria-temp-tablesMake the temporary tables within MySQL use the Maria storage engine
 5.1.24 Yes
--with-max-indexesSets the maximum number of indexes per table
64  Yes
--with-mysqld-ldflagsExtra linking arguments for mysqld
   Yes
--with-mysqld-libsExtra libraries to link with for mysqld
   Yes
--with-mysqld-userWhat user the mysqld daemon shall be run as
   Yes
--with-mysqlmanagerBuild the mysqlmanager binary
Build if server is built  Yes
--with-named-curses-libsUse specified curses libraries
   Yes
--with-named-thread-libsUse specified thread libraries
   Yes
--with-ndb-ccflagsExtra CC options for ndb compile
   Yes
--with-ndb-docsInclude the NDB Cluster ndbapi and mgmapi documentation
   Yes
--with-ndb-portPort for NDB Cluster management server
   Yes
--with-ndb-port-basePort for NDB Cluster management server
   Yes
--with-ndb-sciProvide MySQL with a custom location of sci library
   Yes
--with-ndb-testInclude the NDB Cluster ndbapi test programs
   Yes
--with-ndbclusterInclude the NDB Cluster table handler
no 5.1.9Yes
--with-opensslInclude the OpenSSL support
  5.1.9Yes
--with-openssl-includesFind OpenSSL headers in DIR
  5.1.9Yes
--with-openssl-libsFind OpenSSL libraries in DIR
  5.1.9Yes
--with-other-libcLink against libc and other standard libraries installed in the specified nonstandard location
   Yes
--with-picTry to use only PIC/non-PIC objects
Use both  Yes
--with-plugin-PLUGINForces the named plugin to be linked into mysqld statically
 5.1.11 Yes
--with-pluginsPlugins to include in mysqld
none5.1.11 Yes
--with-pstackUse the pstack backtrace library
  5.1.54Yes
--with-pthreadForce use of pthread library
   Yes
--with-row-based-replicationInclude row-based replication
 5.1.55.1.6Yes
--with-server-suffixAppend value to the version string
   Yes
--with-sslInclude SSL support
 5.1.11 Yes
--with-system-typeSet the system type, like "sun-solaris10"
   Yes
--with-tagsInclude additional configurations
automatic  Yes
--with-tcp-portWhich port to use for MySQL services
3306  Yes
--with-unix-socket-pathWhere to put the unix-domain socket
   Yes
--with-yasslInclude the yaSSL support
  5.1.9Yes
--with-zlib-dirProvide MySQL with a custom location of compression library
   Yes
--without-PACKAGEDo not use PACKAGE
   Yes
--without-benchSkip building of the benchmark suite
  5.1.11Yes
--without-debugBuild a production version without debugging code
  5.1.6Yes
--without-docsSkip building of the documentation
   Yes
--without-extra-toolsSkip building utilities in the tools directory
  5.1.9Yes
--without-geometryDo not build geometry-related parts
   Yes
--without-libeditUse system libedit instead of bundled copy
   Yes
--without-manSkip building of the man pages
   Yes
--without-ndb-binlogDisable ndb binlog
 5.1.6 Yes
--without-ndb-debugDisable special ndb debug features
   Yes
--without-plugin-PLUGINExclude PLUGIN
 5.1.11 Yes
--without-query-cacheDo not build query cache
   Yes
--without-readlineUse system readline instead of bundled copy
   Yes
--without-row-based-replicationDon't include row-based replication
 5.1.75.1.14Yes
--without-serverOnly build the client
   Yes
--without-ucaSkip building of the national Unicode collations
   Yes