MySQL :: MySQL 8.4 Reference Manual :: 2.8.7 MySQL Source-Configuration Options (original) (raw)
-DADD_GDB_INDEX=bool This option determines whether to enable generation of a.gdb_index section in binaries, which makes loading them in a debugger faster. The option is disabled by default. lld linker is used, and is disabled by It has no effect if a linker other thanlld or GNU gold is used.
-DCOMPRESS_DEBUG_SECTIONS=bool Whether to compress the debug sections of binary executables (Linux only). Compressing executable debug sections saves space at the cost of extra CPU time during the build process. The default is OFF. If this option is not set explicitly but theCOMPRESS_DEBUG_SECTIONS environment variable is set, the option takes its value from that variable.
-DDEFAULT_CHARSET=charset_name The server character set. By default, MySQL uses theutf8mb4 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, utf8mb3,utf8mb4, utf16,utf16le, utf32. This value can be set at server startup with the--character-set-server option.
-DDEFAULT_COLLATION=collation_name The server collation. By default, MySQL usesutf8mb4_0900_ai_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 is OFF (include).
-DDISABLE_PSI_FILE=bool Whether to exclude the Performance Schema file instrumentation. The default is OFF (include).
-DDISABLE_PSI_IDLE=bool Whether to exclude the Performance Schema idle instrumentation. The default is OFF (include).
-DDISABLE_PSI_MEMORY=bool Whether to exclude the Performance Schema memory instrumentation. The default is OFF (include).
-DDISABLE_PSI_METADATA=bool Whether to exclude the Performance Schema metadata instrumentation. The default is OFF (include).
-DDISABLE_PSI_MUTEX=bool Whether to exclude the Performance Schema mutex instrumentation. The default is OFF (include).
-DDISABLE_PSI_RWLOCK=bool Whether to exclude the Performance Schema rwlock instrumentation. The default is OFF (include).
-DDISABLE_PSI_SOCKET=bool Whether to exclude the Performance Schema socket instrumentation. The default is OFF (include).
-DDISABLE_PSI_SP=bool Whether to exclude the Performance Schema stored program instrumentation. The default is OFF (include).
-DDISABLE_PSI_STAGE=bool Whether to exclude the Performance Schema stage instrumentation. The default is OFF (include).
-DDISABLE_PSI_STATEMENT=bool Whether to exclude the Performance Schema statement instrumentation. The default is OFF (include).
-DDISABLE_PSI_STATEMENT_DIGEST=bool Whether to exclude the Performance Schema statement digest instrumentation. The default is OFF (include).
-DDISABLE_PSI_TABLE=bool Whether to exclude the Performance Schema table instrumentation. The default is OFF (include).
-DDISABLE_PSI_PS=bool Exclude the Performance Schema prepared statements instances instrumentation. The default is OFF (include).
-DDISABLE_PSI_THREAD=bool Exclude the Performance Schema thread instrumentation. The default is OFF (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 is OFF (include).
-DDISABLE_PSI_DATA_LOCK=bool Exclude the performance schema data lock instrumentation. The default is OFF (include).
-DDISABLE_PSI_ERROR=bool Exclude the performance schema server error instrumentation. The default is OFF (include).
-DENABLE_EXPERIMENTAL_SYSVARS=bool Whether to enable experimental InnoDB system variables. Experimental system variables are intended for those engaged in MySQL development, should only be used in a development or test environment, and may be removed without notice in a future MySQL release. For information about experimental system variables, refer to/storage/innobase/handler/ha_innodb.cc in the MySQL source tree. Experimental system variables can be identified by searching for“PLUGIN_VAR_EXPERIMENTAL”.
-DENABLED_LOCAL_INFILE=bool This option controls the compiled-in defaultLOCAL capability for the MySQL client library. Clients that make no explicit arrangements therefore have LOCAL 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. If you compile MySQL from source, configure it withENABLED_LOCAL_INFILE disabled or enabled based on whether clients that make no explicit arrangements should have LOCAL capability disabled or enabled, respectively. ENABLED_LOCAL_INFILE controls the default for client-side LOCAL capability. For the server, thelocal_infile system variable controls server-side LOCAL 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 8.1.6, “Security Considerations for LOAD DATA LOCAL”.
-DFPROFILE_GENERATE=bool Whether to generate profile guided optimization (PGO) data. This option is available for experimenting with PGO with GCC. See cmake/fprofile.cmake in the MySQL source distribution for information about usingFPROFILE_GENERATE andFPROFILE_USE. These options have been tested with GCC 8 and 9.
-DFPROFILE_USE=bool Whether to use profile guided optimization (PGO) data. This option is available for experimenting with PGO with GCC. See the cmake/fprofile.cmake file in a MySQL source distribution for information about usingFPROFILE_GENERATE andFPROFILE_USE. These options have been tested with GCC 8 and 9. Enabling FPROFILE_USE also enables WITH_LTO.
-DHAVE_PSI_MEMORY_INTERFACE=bool Whether to enable the performance schema memory tracing module for memory allocation functions (ut::aligned_ _`name`_ library functions) used in dynamic storage of over-aligned types.
-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.
-DWITH_DEVELOPER_ENTITLEMENTS=bool Whether to add the get-task-allow entitlement to all executables to generate a core dump in the event of an unexpected server halt. On macOS 11+, core dumps are limited to processes with thecom.apple.security.get-task-allow entitlement, which this CMake option enables. The entitlement allows other processes to attach and read/modify the processes memory, and allows--core-file to function as expected.
event: Use event mutexes. This is the default value and the original InnoDB mutex implementation.
sys: Use POSIX mutexes on UNIX systems. Use CRITICAL_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.
-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 defaults to ON forRelWithDebInfo builds.
-DWIN_DEBUG_NO_INLINE=bool Whether to disable function inlining on Windows. The default is OFF (inlining enabled).
-DWITH_LD=string CMake uses the standard linker by default. Optionally pass in lld ormold to specify an alternative linker.mold must be version 2 or newer. This option can be used on Linux-based systems other than Enterprise Linux, which always uses theld linker. Note Previously, the option USE_LD_LLD could be used to enable (the default) or disable explicitly the LLVM lld linker for Clang. In MySQL 8.3, USE_LD_LLD has been removed.
-DWITH_ANT=path_name Set the path to Ant, required when building GCS Java wrapper. Set WITH_ANT to the path of a directory where the Ant tarball or unpacked archive is saved. WhenWITH_ANT is not set, or is set with the special value system, the build process assumes a binary ant exists in$PATH.
-DWITH_ASAN=bool Whether to enable the AddressSanitizer, for compilers that support it. The default is OFF.
-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_CLIENT_PLUGINS=bool This option is enabled automatically if any corresponding server authentication plugins are built. Its value thus depends on other CMake options and it should not be set explicitly.
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.
-DWITH_CURL=curl_type The location of the curl library.curltype can besystem (use the systemcurl library), a path name to thecurl library,no|off|none to disable curl support, or bundled to use the bundled curl distribution inextra/curl/.
-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 the InnoDB 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. Enabling WITH_DEBUG also enables Debug Sync. This facility is used for testing and debugging. When compiled in, Debug Sync is disabled by default at runtime. To enable it, startmysqld with the--debug-sync-timeout=N option, where N is a timeout value greater than 0. (The default value is 0, which disables Debug Sync.) N becomes the default timeout for individual synchronization points. Sync debug checking for the InnoDB storage engine is available when debugging support is compiled in using theWITH_DEBUG option. For a description of the Debug Sync facility and how to use synchronization points, seeMySQL Internals: Test Synchronization.
-DWITH_EDITLINE=value Which libedit/editline library to use. The permitted values arebundled (the default) andsystem.
-DWITH_ICU={icu_type|path_name} MySQL uses International Components for Unicode (ICU) to support regular expression operations. TheWITH_ICU option indicates the type of ICU support to include or the path name to the ICU installation to use.
icutype can be one of the following values: * bundled: Use the ICU library bundled with the distribution. This is the default, and is the only supported option for Windows. * system: Use the system ICU library.
pathname is the path name to the ICU installation to use. This can be preferable to using the icutype value ofsystem because it can prevent CMake from detecting and using an older or incorrect ICU version installed on the system. (Another permitted way to do the same thing is to set WITH_ICU to system and set theCMAKE_PREFIX_PATH option to_pathname_.)
-DWITH_INNODB_EXTRA_DEBUG=bool Whether to include extra InnoDB debugging support. Enabling WITH_INNODB_EXTRA_DEBUG turns on extra InnoDB debug checks. This option can only be enabled when WITH_DEBUG is enabled.
-DWITH_JEMALLOC=bool Whether to link with -ljemalloc. If enabled, built-in malloc(),calloc(), realloc(), and free() routines are disabled. The default is OFF. WITH_JEMALLOC andWITH_TCMALLOC are mutually exclusive.
-DWITH_LIBEVENT=string Which libevent library to use. Permitted values are bundled (default) andsystem. If system is specified and no system libevent library can be found, an error occurs regardless, and the bundledlibevent is not used. The libevent library is required by X Plugin and MySQL Router.
-DWITH_LOCK_ORDER=bool Whether to enable LOCK_ORDER tooling. By default, this option is disabled and server builds contain no tooling. If tooling is enabled, the LOCK_ORDER tool is available and can be used as described in Section 7.9.3, “The LOCK_ORDER Tool”. Note With the WITH_LOCK_ORDER option enabled, MySQL builds require theflex program.
-DWITH_LSAN=bool Whether to run LeakSanitizer, without AddressSanitizer. The default is OFF.
-DWITH_LTO=bool Whether to enable the link-time optimizer, if the compiler supports it. The default is OFF unlessFPROFILE_USE is enabled.
bundled: Use thelz4 library bundled with the distribution. This is the default.
system: Use the systemlz4 library.
-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 14.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 is OFF.
-DWITH_NUMA=bool Explicitly set the NUMA memory allocation policy.CMake sets the defaultWITH_NUMA value based on whether the current platform has NUMA 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.
-DWITH_PACKAGE_FLAGS=bool For flags typically used for RPM and Debian packages, whether to add them to standalone builds on those platforms. The default is ON for nondebug builds.
-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. Optionally useINSTALL_PRIV_LIBDIR to modify the dynamic Protobuf library directory.
system: Use the package installed on the system. Other values are ignored, with a fallback tobundled.
-DWITH_RAPID=bool Whether to build the rapid development cycle plugins. When enabled, a rapid directory is created in the build tree containing these plugins. When disabled, no rapid directory is created in the build tree. The default is ON, unless therapid directory is removed from the source tree, in which case the default becomesOFF.
-DWITH_RAPIDJSON=rapidjson_type The type of RapidJSON library support to include.rapidjsontype can be one of the following values:
bundled: Use the RapidJSON library bundled with the distribution. This is the default.
system: Use the system RapidJSON library. Version 1.1.0 or later is required.
-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: * system: Use the system OpenSSL library. This is the default. On macOS and Windows, usingsystem configures MySQL to build as if CMake was invoked with_pathname_ points to a manually installed OpenSSL library. This is because they do not have system SSL libraries. On macOS,brew install openssl installs to /usr/local/opt/openssl so that system can find it. On Windows, it checks%ProgramFiles%/OpenSSL,%ProgramFiles%/OpenSSL-Win32,%ProgramFiles%/OpenSSL-Win64,C:/OpenSSL,C:/OpenSSL-Win32, andC:/OpenSSL-Win64. * yes: This is a synonym forsystem. * openssl_`version`_: Use an alternate OpenSSL system package such asopenssl11 on EL7, oropenssl3 (oropenssl3-fips) on EL8. Authentication plugins, such as LDAP and Kerberos, are disabled as they do not support these alternative versions of OpenSSL.
pathname is the path name to the OpenSSL installation to use. This can be preferable to using the ssltype valuesystem 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 set WITH_SSL to system 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_SHOW_PARSE_TREE=bool Enables support for SHOW PARSE_TREE in the server, used in development and debugging only. Not used for release builds or supported in production.
-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. When the server was built using this option, MySQL includes all systemd messages in the server's error log (see Section 7.4.2, “The Error Log”). For more information about using systemd, see Section 2.5.9, “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_SYSTEMD_DEBUG=bool Whether to produce additional systemd debugging information, for platforms on whichsystemd is used to run MySQL. The default is OFF.
-DWITH_TCMALLOC=bool Whether to link with -ltcmalloc. If enabled, built-in malloc(),calloc(), realloc(), and free() routines are disabled. The default is OFF. Beginning with MySQL 8.4.1, a tcmalloc library is included in the source; you can cause the build to use the bundled version by setting this option toBUNDLED. BUNDLED is supported on Linux systems only. WITH_TCMALLOC andWITH_JEMALLOC are mutually exclusive.
-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, the libmysqlclient 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_TSAN=bool Whether to enable the ThreadSanitizer, for compilers that support it. The default is off.
-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_WIN_JEMALLOC=string On Windows, pass in a path to a directory containingjemalloc.dll to enable jemalloc functionality. The build system copiesjemalloc.dll to the same directory asmysqld.exe and/ormysqld-debug.exe and utilizes it for memory management operations. Standard memory functions are used if jemalloc.dll is not found or does not export the required functions. An INFORMATION level log message records whether or not jemalloc is found and used. This option is enabled for official MySQL binaries for Windows.
-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 of zlib support: The minimum supported version of zlib is 1.2.13.
bundled: Use thezlib library bundled with the distribution. This is the default.
bundled: Use thezstd library bundled with the distribution. This is the default.
system: Use the systemzstd 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. This option also prevents building of theNDB storage engine or anyNDB binaries including management and data node programs.