MySQL :: MySQL 5.7 Reference Manual :: 2.8.7 MySQL Source-Configuration Options (original) (raw)
- -DCOMPILATION_COMMENT=string
A descriptive comment about the compilation environment. - -DDEFAULT_CHARSET=charset_name
The server character set. By default, MySQL uses thelatin1
(cp1252
West European) character set.charsetname
may be one ofbinary
,armscii8
,ascii
,big5
,cp1250
,cp1251
,cp1256
,cp1257
,cp850
,cp852
,cp866
,cp932
,dec8
,eucjpms
,euckr
,gb2312
,gbk
,geostd8
,greek
,hebrew
,hp8
,keybcs2
,koi8r
,koi8u
,latin1
,latin2
,latin5
,latin7
,macce
,macroman
,sjis
,swe7
,tis620
,ucs2
,ujis
,utf8
,utf8mb4
,utf16
,utf16le
,utf32
. The permissible character sets are listed in thecmake/character_sets.cmake
file as the value ofCHARSETS_AVAILABLE
.
This value can be set at server startup with the--character-set-server option. - -DDEFAULT_COLLATION=collation_name
The server collation. By default, MySQL useslatin1_swedish_ci
. Use theSHOW COLLATION statement to determine which collations are available for each character set.
This value can be set at server startup with the--collation_server option. - -DDISABLE_PSI_COND=bool
Whether to exclude the Performance Schema condition instrumentation. The default isOFF
(include). - -DDISABLE_PSI_FILE=bool
Whether to exclude the Performance Schema file instrumentation. The default isOFF
(include). - -DDISABLE_PSI_IDLE=bool
Whether to exclude the Performance Schema idle instrumentation. The default isOFF
(include). - -DDISABLE_PSI_MEMORY=bool
Whether to exclude the Performance Schema memory instrumentation. The default isOFF
(include). - -DDISABLE_PSI_METADATA=bool
Whether to exclude the Performance Schema metadata instrumentation. The default isOFF
(include). - -DDISABLE_PSI_MUTEX=bool
Whether to exclude the Performance Schema mutex instrumentation. The default isOFF
(include). - -DDISABLE_PSI_RWLOCK=bool
Whether to exclude the Performance Schema rwlock instrumentation. The default isOFF
(include). - -DDISABLE_PSI_SOCKET=bool
Whether to exclude the Performance Schema socket instrumentation. The default isOFF
(include). - -DDISABLE_PSI_SP=bool
Whether to exclude the Performance Schema stored program instrumentation. The default isOFF
(include). - -DDISABLE_PSI_STAGE=bool
Whether to exclude the Performance Schema stage instrumentation. The default isOFF
(include). - -DDISABLE_PSI_STATEMENT=bool
Whether to exclude the Performance Schema statement instrumentation. The default isOFF
(include). - -DDISABLE_PSI_STATEMENT_DIGEST=bool
Whether to exclude the Performance Schema statement digest instrumentation. The default isOFF
(include). - -DDISABLE_PSI_TABLE=bool
Whether to exclude the Performance Schema table instrumentation. The default isOFF
(include). - -DDISABLE_PSI_PS=bool
Exclude the Performance Schema prepared statements instances instrumentation. The default isOFF
(include). - -DDISABLE_PSI_THREAD=bool
Exclude the Performance Schema thread instrumentation. The default isOFF
(include).
Only disable threads when building without any instrumentation, because other instrumentations have a dependency on threads. - -DDISABLE_PSI_TRANSACTION=bool
Exclude the Performance Schema transaction instrumentation. The default isOFF
(include). - -DDOWNLOAD_BOOST=bool
Whether to download the Boost library. The default isOFF
.
See the WITH_BOOST option for additional discussion about using Boost. - -DDOWNLOAD_BOOST_TIMEOUT=seconds
The timeout in seconds for downloading the Boost library. The default is 600 seconds.
See the WITH_BOOST option for additional discussion about using Boost. - -DENABLE_DOWNLOADS=bool
Whether to download optional files. For example, with this option enabled, CMake downloads the Google Test distribution that is used by the test suite to run unit tests. - -DENABLE_DTRACE=bool
Whether to include support for DTrace probes. For information about DTrace, weeSection 5.8.4, “Tracing mysqld Using DTrace”
This option is deprecated because support for DTrace is deprecated in MySQL 5.7 and is removed in MySQL 8.0. - -DENABLE_GCOV=bool
Whether to include gcov support (Linux only). - -DENABLE_GPROF=bool
Whether to enable gprof (optimized Linux builds only). - -DENABLED_LOCAL_INFILE=bool
This option controls the compiled-in defaultLOCAL
capability for the MySQL client library. Clients that make no explicit arrangements therefore haveLOCAL
capability disabled or enabled according to theENABLED_LOCAL_INFILE setting specified at MySQL build time.
By default, the client library in MySQL binary distributions is compiled withENABLED_LOCAL_INFILE disabled. (Prior to MySQL 5.7.6, it was enabled by default.) If you compile MySQL from source, configure it withENABLED_LOCAL_INFILE disabled or enabled based on whether clients that make no explicit arrangements should haveLOCAL
capability disabled or enabled, respectively.
ENABLED_LOCAL_INFILE controls the default for client-sideLOCAL
capability. For the server, thelocal_infile system variable controls server-sideLOCAL
capability. To explicitly cause the server to refuse or permit LOAD DATA LOCAL statements (regardless of how client programs and libraries are configured at build time or runtime), start mysqld with--local-infile disabled or enabled, respectively.local_infile can also be set at runtime. SeeSection 6.1.6, “Security Considerations for LOAD DATA LOCAL”. - -DENABLED_PROFILING=bool
Whether to enable query profiling code (for theSHOW PROFILE andSHOW PROFILES statements). - -DFORCE_UNSUPPORTED_COMPILER=bool
By default, CMake checks for minimum versions of supported compilers: Visual Studio 2013 (Windows); GCC 4.4 or Clang 3.3 (Linux); Developer Studio 12.5 (Solaris server); Developer Studio 12.2 or GCC 4.4 (Solaris client library); Clang 3.3 (macOS), Clang 3.3 (FreeBSD). To disable this check, use-DFORCE_UNSUPPORTED_COMPILER=ON. - -DIGNORE_AIO_CHECK=bool
If the-DBUILD_CONFIG=mysql_release option is given on Linux, thelibaio
library must be linked in by default. If you do not havelibaio
or do not want to install it, you can suppress the check for it by specifying-DIGNORE_AIO_CHECK=1. - -DMAX_INDEXES=num
The maximum number of indexes per table. The default is 64. The maximum is 255. Values smaller than 64 are ignored and the default of 64 is used. - -DMYSQL_MAINTAINER_MODE=bool
Whether to enable a MySQL maintainer-specific development environment. If enabled, this option causes compiler warnings to become errors. - -DMUTEX_TYPE=type
The mutex type used byInnoDB
. Options include:event
: Use event mutexes. This is the default value and the originalInnoDB
mutex implementation.sys
: Use POSIX mutexes on UNIX systems. UseCRITICAL_SECTION
objects on Windows, if available.futex
: Use Linux futexes instead of condition variables to schedule waiting threads.
- -DMYSQLX_TCP_PORT=port_num
The port number on which X Plugin listens for TCP/IP connections. The default is 33060.
This value can be set at server startup with themysqlx_port system variable. - -DMYSQLX_UNIX_ADDR=file_name
The Unix socket file path on which the server listens for X Plugin socket connections. This must be an absolute path name. The default is/tmp/mysqlx.sock
.
This value can be set at server startup with themysqlx_port system variable. - -DMYSQL_PROJECT_NAME=name
For Windows or macOS, the project name to incorporate into the project file name. - -DMYSQL_TCP_PORT=port_num
The port number on which the server listens for TCP/IP connections. The default is 3306.
This value can be set at server startup with the--port option. - -DMYSQL_UNIX_ADDR=file_name
The Unix socket file path on which the server listens for socket connections. This must be an absolute path name. The default is/tmp/mysql.sock
.
This value can be set at server startup with the--socket option. - -DOPTIMIZER_TRACE=bool
Whether to support optimizer tracing. SeeSection 8.15, “Tracing the Optimizer”. - -DREPRODUCIBLE_BUILD=bool
For builds on Linux systems, this option controls whether to take extra care to create a build result independent of build location and time.
This option was added in MySQL 5.7.19. - -DWIN_DEBUG_NO_INLINE=bool
Whether to disable function inlining on Windows. The default isOFF
(inlining enabled). - -DWITH_ASAN=bool
Whether to enable the AddressSanitizer, for compilers that support it. The default isOFF
. - -DWITH_ASAN_SCOPE=bool
Whether to enable the AddressSanitizer-fsanitize-address-use-after-scope
Clang flag for use-after-scope detection. The default is off. To use this option,-DWITH_ASAN
must also be enabled. - -DWITH_AUTHENTICATION_LDAP=bool
Whether to report an error if the LDAP authentication plugins cannot be built:- If this option is disabled (the default), the LDAP plugins are built if the required header files and libraries are found. If they are not,CMake displays a note about it.
- If this option is enabled, a failure to find the required header file and libraries causes CMake to produce an error, preventing the server from being built.
For information about LDAP authentication, seeSection 6.4.1.9, “LDAP Pluggable Authentication”. This option was added in MySQL 5.7.19.
- -DWITH_AUTHENTICATION_PAM=bool
Whether to build the PAM authentication plugin, for source trees that include this plugin. (SeeSection 6.4.1.7, “PAM Pluggable Authentication”.) If this option is specified and the plugin cannot be compiled, the build fails. - -DWITH_AWS_SDK=path_name
The location of the Amazon Web Services software development kit.
This option was added in MySQL 5.7.19. - -DWITH_BOOST=path_name
The Boost library is required to build MySQL. TheseCMake options enable control over the library source location, and whether to download it automatically:- -DWITH_BOOST=path_name specifies the Boost library directory location. It is also possible to specify the Boost location by setting the
BOOST_ROOT
orWITH_BOOST
environment variable.
As of MySQL 5.7.11,-DWITH_BOOST=system is also permitted and indicates that the correct version of Boost is installed on the compilation host in the standard location. In this case, the installed version of Boost is used rather than any version included with a MySQL source distribution. - -DDOWNLOAD_BOOST=bool specifies whether to download the Boost source if it is not present in the specified location. The default is
OFF
. - -DDOWNLOAD_BOOST_TIMEOUT=seconds the timeout in seconds for downloading the Boost library. The default is 600 seconds.
For example, if you normally build MySQL placing the object output in thebld
subdirectory of your MySQL source tree, you can build with Boost like this:
- -DWITH_BOOST=path_name specifies the Boost library directory location. It is also possible to specify the Boost location by setting the
mkdir bld
cd bld
cmake .. -DDOWNLOAD_BOOST=ON -DWITH_BOOST=$HOME/my_boost
This causes Boost to be downloaded into themy_boost
directory under your home directory. If the required Boost version is already there, no download is done. If the required Boost version changes, the newer version is downloaded.
If Boost is already installed locally and your compiler finds the Boost header files on its own, it may not be necessary to specify the preceding CMake options. However, if the version of Boost required by MySQL changes and the locally installed version has not been upgraded, you may have build problems. Using theCMake options should give you a successful build.
With the above settings that allow Boost download into a specified location, when the required Boost version changes, you need to remove the bld
folder, recreate it, and perform the cmake step again. Otherwise, the new Boost version might not get downloaded, and compilation might fail.
- -DWITH_CLIENT_PROTOCOL_TRACING=bool
Whether to build the client-side protocol tracing framework into the client library. By default, this option is enabled.
For information about writing protocol trace client plugins, see Writing Protocol Trace Plugins.
See also theWITH_TEST_TRACE_PLUGIN option. - -DWITH_CURL=curl_type
The location of thecurl
library.curltype
can besystem
(use the systemcurl
library) or a path name to thecurl
library.
This option was added in MySQL 5.7.19. - -DWITH_DEBUG=bool
Whether to include debugging support.
Configuring MySQL with debugging support enables you to use the --debug="d,parser_debug" option when you start the server. This causes the Bison parser that is used to process SQL statements to dump a parser trace to the server's standard error output. Typically, this output is written to the error log.
Sync debug checking for theInnoDB
storage engine is defined underUNIV_DEBUG
and is available when debugging support is compiled in using theWITH_DEBUG option. When debugging support is compiled in, theinnodb_sync_debug configuration option can be used to enable or disableInnoDB
sync debug checking.
As of MySQL 5.7.18, enablingWITH_DEBUG also enables Debug Sync. For a description of the Debug Sync facility and how to use synchronization points, seeMySQL Internals: Test Synchronization. - -DWITH_DEFAULT_FEATURE_SET=bool
Whether to use the flags fromcmake/build_configurations/feature_set.cmake
. - -DWITH_EDITLINE=value
Whichlibedit
/editline
library to use. The permitted values arebundled
(the default) andsystem
.
WITH_EDITLINE replacesWITH_LIBEDIT
, which has been removed. - -DWITH_EMBEDDED_SERVER=bool
Whether to build thelibmysqld
embedded server library.
Note
Thelibmysqld
embedded server library is deprecated as of MySQL 5.7.17 and has been removed in MySQL 8.0. - -DWITH_EMBEDDED_SHARED_LIBRARY=bool
Whether to build a sharedlibmysqld
embedded server library.
Note
Thelibmysqld
embedded server library is deprecated as of MySQL 5.7.17 and has been removed in MySQL 8.0. - -DWITH_EXTRA_CHARSETS=name
Which extra character sets to include:all
: All character sets. This is the default.complex
: Complex character sets.none
: No extra character sets.
- -DWITH_GMOCK=path_name
The path to the googlemock distribution, for use with Google Test-based unit tests. The option value is the path to the distribution Zip file. Alternatively, set theWITH_GMOCK
environment variable to the path name. It is also possible to use-DENABLE_DOWNLOADS=1
, in which caseCMake downloads the distribution from GitHub.
If you build MySQL without the Google Test unit tests (by configuring wihoutWITH_GMOCK),CMake displays a message indicating how to download it. - -DWITH_INNODB_EXTRA_DEBUG=bool
Whether to include extra InnoDB debugging support.
EnablingWITH_INNODB_EXTRA_DEBUG
turns on extra InnoDB debug checks. This option can only be enabled when WITH_DEBUG is enabled. - -DWITH_INNODB_MEMCACHED=bool
Whether to generate memcached shared libraries (libmemcached.so
andinnodb_engine.so
). - -DWITH_KEYRING_TEST=bool
Whether to build the test program that accompanies thekeyring_file
plugin. The default isOFF
. Test file source code is located in theplugin/keyring/keyring-test
directory.
This option was added in MySQL 5.7.11. - -DWITH_LDAP=value
Internal use only. This option was added in MySQL 5.7.29. - -DWITH_LIBEVENT=string
Whichlibevent
library to use. Permitted values arebundled
(default) andsystem
. Prior to MySQL 5.7.31, if you specifysystem
, the systemlibevent
library is used if present, and an error occurs otherwise. In MySQL 5.7.31 and later, ifsystem
is specified and no systemlibevent
library can be found, an error occurs regardless, and the bundledlibevent
is not used.
Thelibevent
library is required byInnoDB
memcached and X Plugin. - -DWITH_LIBWRAP=bool
Whether to includelibwrap
(TCP wrappers) support. - -DWITH_LZ4=lz4_type
The WITH_LZ4 option indicates the source ofzlib
support:bundled
: Use thelz4
library bundled with the distribution. This is the default.system
: Use the systemlz4
library. IfWITH_LZ4 is set to this value, the lz4_decompress utility is not built. In this case, the systemlz4 command can be used instead.
- -DWITH_MECAB={disabled|system|path_name}
Use this option to compile the MeCab parser. If you have installed MeCab to its default installation directory, set-DWITH_MECAB=system
. Thesystem
option applies to MeCab installations performed from source or from binaries using a native package management utility. If you installed MeCab to a custom installation directory, specify the path to the MeCab installation, for example,-DWITH_MECAB=/opt/mecab
. If thesystem
option does not work, specifying the MeCab installation path should work in all cases.
For related information, seeSection 12.9.9, “MeCab Full-Text Parser Plugin”. - -DWITH_MSAN=bool
Whether to enable MemorySanitizer, for compilers that support it. The default is off.
For this option to have an effect if enabled, all libraries linked to MySQL must also have been compiled with the option enabled. - -DWITH_MSCRT_DEBUG=bool
Whether to enable Visual Studio CRT memory leak tracing. The default isOFF
. - -DWITH_NUMA=bool
Explicitly set the NUMA memory allocation policy.CMake sets the defaultWITH_NUMA value based on whether the current platform hasNUMA
support. For platforms without NUMA support,CMake behaves as follows:- With no NUMA option (the normal case),CMake continues normally, producing only this warning: NUMA library missing or required version not available.
- With -DWITH_NUMA=ON,CMake aborts with this error:NUMA library missing or required version not available.
This option was added in MySQL 5.7.17.
- -DWITH_PROTOBUF=protobuf_type
Which Protocol Buffers package to use.protobuftype
can be one of the following values:bundled
: Use the package bundled with the distribution. This is the default.system
: Use the package installed on the system.
Other values are ignored, with a fallback tobundled
.
This option was added in MySQL 5.7.12.
- -DWITH_RAPID=bool
Whether to build the rapid development cycle plugins. When enabled, arapid
directory is created in the build tree containing these plugins. When disabled, norapid
directory is created in the build tree. The default isON
, unless therapid
directory is removed from the source tree, in which case the default becomesOFF
. This option was added in MySQL 5.7.12. - -DWITH_SASL=value
Internal use only. This option was added in MySQL 5.7.29. Not supported on Windows. - -DWITH_SSL={ssl_type|
pathname
}
For support of encrypted connections, entropy for random number generation, and other encryption-related operations, MySQL must be built using an SSL library. This option specifies which SSL library to use.ssltype
can be one of the following values:
*yes
: Use the system OpenSSL library if present, else the library bundled with the distribution.
*bundled
: Use the SSL library bundled with the distribution. This is the default prior to MySQL 5.7.28. As of 5.7.28, this is no longer a permitted value and the default issystem
.
*system
: Use the system OpenSSL library. This is the default as of MySQL 5.7.28.pathname
is the path name to the OpenSSL installation to use. This can be preferable to using thessltype
value ofsystem
because it can prevent CMake from detecting and using an older or incorrect OpenSSL version installed on the system. (Another permitted way to do the same thing is to setWITH_SSL
tosystem
and set theCMAKE_PREFIX_PATH
option to_pathname
_.)
For additional information about configuring the SSL library, seeSection 2.8.6, “Configuring SSL Library Support”.
- -DWITH_SYSTEMD=bool
Whether to enable installation of systemd support files. By default, this option is disabled. When enabled, systemd support files are installed, and scripts such asmysqld_safe and the System V initialization script are not installed. On platforms wheresystemd is not available, enablingWITH_SYSTEMD results in an error from CMake.
For more information about using systemd, see Section 2.5.10, “Managing MySQL Server with systemd”. That section also includes information about specifying options otherwise specified in[mysqld_safe]
option groups. Because mysqld_safe is not installed whensystemd is used, such options must be specified another way. - -DWITH_TEST_TRACE_PLUGIN=bool
Whether to build the test protocol trace client plugin (seeUsing the Test Protocol Trace Plugin). By default, this option is disabled. Enabling this option has no effect unless theWITH_CLIENT_PROTOCOL_TRACING option is enabled. If MySQL is configured with both options enabled, thelibmysqlclient
client library is built with the test protocol trace plugin built in, and all the standard MySQL clients load the plugin. However, even when the test plugin is enabled, it has no effect by default. Control over the plugin is afforded using environment variables; seeUsing the Test Protocol Trace Plugin.
Note
Do not enable theWITH_TEST_TRACE_PLUGIN option if you want to use your own protocol trace plugins because only one such plugin can be loaded at a time and an error occurs for attempts to load a second one. If you have already built MySQL with the test protocol trace plugin enabled to see how it works, you must rebuild MySQL without it before you can use your own plugins.
For information about writing trace plugins, seeWriting Protocol Trace Plugins. - -DWITH_UBSAN=bool
Whether to enable the Undefined Behavior Sanitizer, for compilers that support it. The default is off. - -DWITH_UNIT_TESTS={ON|OFF}
If enabled, compile MySQL with unit tests. The default isON
unless the server is not being compiled. - -DWITH_UNIXODBC=1
Enables unixODBC support, for Connector/ODBC. - -DWITH_VALGRIND=bool
Whether to compile in the Valgrind header files, which exposes the Valgrind API to MySQL code. The default isOFF
.
To generate a Valgrind-aware debug build,-DWITH_VALGRIND=1 normally is combined with -DWITH_DEBUG=1. SeeBuilding Debug Configurations. - -DWITH_ZLIB=zlib_type
Some features require that the server be built with compression library support, such as theCOMPRESS() andUNCOMPRESS() functions, and compression of the client/server protocol. TheWITH_ZLIB option indicates the source ofzlib
support:bundled
: Use thezlib
library bundled with the distribution. This is the default.system
: Use the systemzlib
library.
- -DWITHOUT_SERVER=bool
Whether to build without MySQL Server. The default is OFF, which does build the server.
This is considered an experimental option; it is preferred to build with the server.