Chapter 4 Build (Configuration) Options

The following tables details the CMake configuration options available when building MySQL server from source. The tables includes the following columns:

Table 4.1 Build (CMake) options

NameDescription
DefaultIntroducedRemoved5.55.65.78.0
BUILD_CONFIGUse same build options as official releases
 5.5.7 YesYesYesYes
CMAKE_BUILD_TYPEType of build to produce
RelWithDebInfo5.5.7 YesYesYesYes
CMAKE_CXX_FLAGSFlags for C++ Compiler
   YesYesYesYes
CMAKE_C_FLAGSFlags for C Compiler
   YesYesYesYes
CMAKE_INSTALL_PREFIXInstallation base directory
/usr/local/mysql5.5.8 YesYesYesYes
COMPILATION_COMMENTComment about compilation environment
 5.5.7 YesYesYesYes
CPACK_MONOLITHIC_INSTALLWhether package build produces single file
OFF5.5.7 YesYesYesYes
DEFAULT_CHARSETThe default server character set
latin15.5.7 YesYesYesYes
DEFAULT_COLLATIONThe default server collation
latin1_swedish_ci5.5.7 YesYesYesYes
DISABLE_PSI_CONDExclude Performance Schema condition instrumentation
OFF5.7.3   YesYes
DISABLE_PSI_FILEExclude Performance Schema file instrumentation
OFF5.7.3   YesYes
DISABLE_PSI_IDLEExclude Performance Schema idle instrumentation
OFF5.7.3   YesYes
DISABLE_PSI_MEMORYExclude Performance Schema memory instrumentation
OFF5.7.3   YesYes
DISABLE_PSI_METADATAExclude Performance Schema metadata instrumentation
OFF5.7.3   YesYes
DISABLE_PSI_MUTEXExclude Performance Schema mutex instrumentation
OFF5.7.3   YesYes
DISABLE_PSI_RWLOCKExclude Performance Schema rwlock instrumentation
OFF5.7.3   YesYes
DISABLE_PSI_SOCKETExclude Performance Schema socket instrumentation
OFF5.7.3   YesYes
DISABLE_PSI_SPExclude Performance Schema stored program instrumentation
OFF5.7.3   YesYes
DISABLE_PSI_STAGEExclude Performance Schema stage instrumentation
OFF5.7.3   YesYes
DISABLE_PSI_STATEMENTExclude Performance Schema statement instrumentation
OFF5.7.3   YesYes
DISABLE_PSI_STATEMENT_DIGESTExclude Performance Schema statement_digest instrumentation
OFF5.7.3   YesYes
DISABLE_PSI_TABLEExclude Performance Schema table instrumentation
OFF5.7.3   YesYes
DISABLE_SHAREDDo not build shared libraries, compile position-dependent code
OFF     Yes
DOWNLOAD_BOOSTWhether to download the Boost library
OFF5.7.5   YesYes
DOWNLOAD_BOOST_TIMEOUTTimeout in seconds for downloading the Boost library
6005.7.6   YesYes
-DUSE_LD_GOLDWhether to use GNU gold loader
OFF8.0.0    Yes
-DWITH_PROTOBUFWhich Protocol Buffers package to use
bundled5.7.12   YesYes
-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 YesYesYesYes
ENABLED_PROFILINGWhether to enable query profiling code
ON5.5.7 YesYesYesYes
ENABLE_DEBUG_SYNCWhether to enable Debug Sync support
ON5.5.7 YesYesYesYes
ENABLE_DOWNLOADSWhether to download optional files
OFF5.5.7 YesYesYesYes
ENABLE_DTRACEWhether to include DTrace support
 5.5.7 YesYesYesYes
ENABLE_GCOVWhether to include gcov support
 5.5.14, 5.6.3 YesYesYesYes
ENABLE_GPROFEnable gprof (optimized Linux builds only)
OFF5.6.6  YesYesYes
FORCE_UNSUPPORTED_COMPILERWhether to permit unsupported compiler
OFF5.7.5   YesYes
IGNORE_AIO_CHECKWith -DBUILD_CONFIG=mysql_release, ignore libaio check
OFF5.5.9, 5.6.1 YesYesYesYes
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 YesYesYesYes
INSTALL_DOCDIRDocumentation directory
PREFIX/docs5.5.7 YesYesYesYes
INSTALL_DOCREADMEDIRREADME file directory
PREFIX5.5.7 YesYesYesYes
INSTALL_INCLUDEDIRHeader file directory
PREFIX/include5.5.7 YesYesYesYes
INSTALL_INFODIRInfo file directory
PREFIX/docs5.5.7 YesYesYesYes
INSTALL_LAYOUTSelect predefined installation layout
STANDALONE5.5.7 YesYesYesYes
INSTALL_LIBDIRLibrary file directory
PREFIX/lib5.5.7 YesYesYesYes
INSTALL_MANDIRManual page directory
PREFIX/man5.5.7 YesYesYesYes
INSTALL_MYSQLKEYRINGDIRDirectory for keyring_file plugin data file
platform specific5.7.11   YesYes
INSTALL_MYSQLSHAREDIRShared data directory
PREFIX/share5.5.7 YesYesYesYes
INSTALL_MYSQLTESTDIRmysql-test directory
PREFIX/mysql-test5.5.7 YesYesYesYes
INSTALL_PKGCONFIGDIRDirectory for mysqlclient.pc pkg-config file
INSTALL_LIBDIR/pkgconfig5.7.9   YesYes
INSTALL_PLUGINDIRPlugin directory
PREFIX/lib/plugin5.5.7 YesYesYesYes
INSTALL_SBINDIRServer executable directory
PREFIX/bin5.5.7 YesYesYesYes
INSTALL_SCRIPTDIRScripts directory
PREFIX/scripts5.5.78.0.0YesYesYes 
INSTALL_SECURE_FILE_PRIVDIRsecure_file_priv default value
platform specific5.5.53, 5.6.34, 5.7.6 YesYesYesYes
INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIRsecure_file_priv default value for libmysqld
 5.5.53, 5.6.34, 5.7.8 YesYesYesYes
INSTALL_SHAREDIRaclocal/mysql.m4 installation directory
PREFIX/share5.5.7 YesYesYesYes
INSTALL_SQLBENCHDIRsql-bench directory
PREFIX5.5.75.7.8YesYesYes 
INSTALL_STATIC_LIBRARIESWhether to install static libraries
ON     Yes
INSTALL_SUPPORTFILESDIRExtra support files directory
PREFIX/support-files5.5.7 YesYesYesYes
MAX_INDEXESMaximum indexes per table
645.7.1   YesYes
MEMCACHED_HOMEPath to memcached
[none]5.5.16-ndb-7.2.2 YesYes  
MUTEX_TYPEInnoDB mutex type
event5.7.2   YesYes
MYSQL_DATADIRData directory
 5.5.7 YesYesYesYes
MYSQL_MAINTAINER_MODEWhether to enable MySQL maintainer-specific development environment
OFF5.5.7 YesYesYesYes
MYSQL_PROJECT_NAMEWindows/OS X project name
33065.5.21, 5.6.5 YesYesYesYes
MYSQL_TCP_PORTTCP/IP port number
33065.5.7 YesYesYesYes
MYSQL_UNIX_ADDRUnix socket file
/tmp/mysql.sock5.5.7 YesYesYesYes
ODBC_INCLUDESODBC includes directory
   YesYesYesYes
ODBC_LIB_DIRODBC library directory
   YesYesYesYes
OPTIMIZER_TRACEWhether to support optimizer tracing
 5.6.3  YesYesYes
SUNPRO_CXX_LIBRARYClient link library on Solaris 10+
 5.6.20, 5.7.58.0.0 YesYes 
SYSCONFDIROption file directory
 5.5.7 YesYesYesYes
SYSTEMD_PID_DIRDirectory for PID file under systemd
/var/run/mysqld5.7.6   YesYes
SYSTEMD_SERVICE_NAMEName of MySQL service under systemd
mysqld5.7.6   YesYes
TMPDIRtmpdir default value
 5.5.36, 5.6.16, 5.7.4 YesYesYesYes
WIN_DEBUG_NO_INLINEWhether to disable function inlining
OFF5.7.6   YesYes
WITHOUT_SERVERDo not build the server
OFF  YesYesYesYes
WITHOUT_xxx_STORAGE_ENGINEExclude storage engine xxx from build
 5.5.7 YesYesYesYes
WITH_ASANEnable AddressSanitizer
OFF5.5.35, 5.6.15, 5.7.3 YesYesYesYes
WITH_AUTHENTICATION_PAMBuild PAM authentication plugin
OFF    YesYes
WITH_BOOSTThe location of the Boost library sources
 5.7.5   YesYes
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   YesYes
WITH_DEBUGWhether to include debugging support
OFF5.5.7 YesYesYesYes
WITH_DEFAULT_COMPILER_OPTIONSWhether to use default compiler options
ON5.6.6  YesYesYes
WITH_DEFAULT_FEATURE_SETWhether to use default feature set
ON5.6.6  YesYesYes
WITH_EDITLINEWhich libedit/editline library to use
bundled5.6.12, 5.7.2  YesYesYes
WITH_EMBEDDED_SERVERWhether to build embedded server
OFF5.5.7 YesYesYesYes
WITH_EMBEDDED_SHARED_LIBRARYWhether to build a shared embedded server library
OFF5.5.37, 5.6.17, 5.7.4 YesYesYesYes
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.78.0.0YesYesYes 
WITH_INNODB_EXTRA_DEBUGWhether to include extra debugging support for InnoDB.
OFF5.7.2   YesYes
WITH_INNODB_MEMCACHEDWhether to generate memcached shared libraries.
OFF   YesYesYes
WITH_KEYRING_TESTBuild the keyring test program
OFF5.7.11   YesYes
WITH_LIBEDITUse bundled libedit library
ON5.5.75.6.12YesYes  
WITH_LIBEVENTWhich libevent library to use
bundled5.6.6  YesYesYes
WITH_LIBWRAPWhether to include libwrap (TCP wrappers) support
OFF5.5.7 YesYesYesYes
WITH_LZ4Type of LZ4 support
bundled5.7.14   YesYes
WITH_MECABCompiles MeCab
 5.7.6   YesYes
WITH_MSANEnable MemorySanitizer
OFF5.7.4   YesYes
WITH_MSCRT_DEBUGEnable Visual Studio CRT memory leak tracing
OFF5.7.6   YesYes
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_NUMASet NUMA memory allocation policy
 5.6.27, 5.7.17  YesYesYes
WITH_RAPIDWhether to build rapid development cycle plugins
ON5.7.12   YesYes
WITH_READLINEUse bundled readline library
OFF5.5.75.6.5YesYes  
WITH_SSLType of SSL support
bundled5.5.7 YesYesYesYes
WITH_SYSTEMDEnable installation of systemd support files
OFF5.7.6   YesYes
WITH_TEST_TRACE_PLUGINBuild test protocol trace plugin
OFF5.7.2   YesYes
WITH_TSANEnable ThreadSanitizer
OFF     Yes
WITH_UBSANEnable Undefined Behavior Sanitizer
OFF5.7.6   YesYes
WITH_UNIXODBCEnable unixODBC support
OFF  YesYesYesYes
WITH_VALGRINDWhether to compile in Valgrind header files
OFF5.5.6 YesYesYesYes
WITH_ZLIBType of zlib support
bundled5.5.7 YesYesYesYes
WITH_xxx_STORAGE_ENGINECompile storage engine xxx statically into server
 5.5.7 YesYesYesYes