MySQL Source-Configuration Options

http://dev.mysql.com/doc/refman/5.6/en/source-configuration-options.html#option_cmake_storage_engine_options

2.9.4. MySQL Source-Configuration Options

The CMake program provides a great deal of control over how you configure a MySQL source distribution. Typically, you do this using options on the CMake command line. For information about options supported by CMake, run either of these commands in the top-level source directory:

shell> cmake . -LH
shell> ccmake .

You can also affect CMake using certain environment variables. See Section 2.12, “Environment Variables”.

The following table shows the available CMake options. In the Default column, PREFIX stands for the value of the CMAKE_INSTALL_PREFIX option, which specifies the installation base directory. This value is used as the parent location for several of the installation subdirectories.

Table 2.12. MySQL Source-Configuration Option Reference (CMake)

FormatsDescriptionDefaultIntroducedRemoved
BUILD_CONFIGUse same build options as official releases  
CMAKE_BUILD_TYPEType of build to produceRelWithDebInfo  
CMAKE_INSTALL_PREFIXInstallation base directory/usr/local/mysql  
COMPILATION_COMMENTComment about compilation environment  
CPACK_MONOLITHIC_INSTALLWhether package build produces single fileOFF  
DEFAULT_CHARSETThe default server character setlatin1  
DEFAULT_COLLATIONThe default server collationlatin1_swedish_ci  
ENABLE_DEBUG_SYNCWhether to enable Debug Sync supportON  
ENABLE_DOWNLOADSWhether to download optional filesOFF  
ENABLE_DTRACEWhether to include DTrace support  
ENABLE_GCOVWhether to include gcov support5.6.3 
ENABLE_GPROFEnable gprof (optimized Linux builds only)OFF5.6.6 
ENABLED_LOCAL_INFILEWhether to enable LOCAL for LOAD DATA INFILEOFF  
ENABLED_PROFILINGWhether to enable query profiling codeON  
INSTALL_BINDIRUser executables directoryPREFIX/bin  
INSTALL_DOCDIRDocumentation directoryPREFIX/docs  
INSTALL_DOCREADMEDIRREADME file directoryPREFIX  
INSTALL_INCLUDEDIRHeader file directoryPREFIX/include  
INSTALL_INFODIRInfo file directoryPREFIX/docs  
INSTALL_LAYOUTSelect predefined installation layoutSTANDALONE  
INSTALL_LIBDIRLibrary file directoryPREFIX/lib  
INSTALL_MANDIRManual page directoryPREFIX/man  
INSTALL_MYSQLSHAREDIRShared data directoryPREFIX/share  
INSTALL_MYSQLTESTDIRmysql-test directoryPREFIX/mysql-test  
INSTALL_PLUGINDIRPlugin directoryPREFIX/lib/plugin  
INSTALL_SBINDIRServer executable directoryPREFIX/bin  
INSTALL_SCRIPTDIRScripts directoryPREFIX/scripts  
INSTALL_SHAREDIRaclocal/mysql.m4 installation directoryPREFIX/share  
INSTALL_SQLBENCHDIRsql-bench directoryPREFIX  
INSTALL_SUPPORTFILESDIRExtra support files directoryPREFIX/support-files  
MYSQL_DATADIRData directory  
MYSQL_MAINTAINER_MODEWhether to enable MySQL maintainer-specific development environmentOFF  
MYSQL_PROJECT_NAMEWindows/Mac OS X project name33065.6.5 
MYSQL_TCP_PORTTCP/IP port number3306  
MYSQL_UNIX_ADDRUnix socket file/tmp/mysql.sock  
ODBC_INCLUDESODBC includes directory  
ODBC_LIB_DIRODBC library directory  
SYSCONFDIROption file directory  
WITH_DEBUGWhether to include debugging supportOFF  
WITH_DEFAULT_COMPILER_OPTIONSWhether to use default compiler optionsON5.6.6 
WITH_DEFAULT_FEATURE_SETWhether to use default feature setON5.6.6 
WITH_EMBEDDED_SERVERWhether to build embedded serverOFF  
WITH_xxx_STORAGE_ENGINECompile storage engine xxx statically into server  
WITH_EXTRA_CHARSETSWhich extra character sets to includeall  
WITH_LIBWRAPWhether to include libwrap (TCP wrappers) supportOFF  
WITH_READLINEUse bundled readlineOFF 5.6.5
WITH_SSLType of SSL supportno  
WITH_UNIXODBCEnable unixODBC supportOFF  
WITH_ZLIBType of zlib supportsystem  
WITHOUT_xxx_STORAGE_ENGINEExclude storage engine xxx from build  


 

The following sections provide more information about CMake options.

For boolean options, the value may be specified as 1 or ON to enable the option, or as 0 or OFF to disable the option.

Many options configure compile-time defaults that can be overridden at server startup. For example, the CMAKE_INSTALL_PREFIX, MYSQL_TCP_PORT, and MYSQL_UNIX_ADDR options that configure the default installation base directory location, TCP/IP port number, and Unix socket file can be changed at server startup with the --basedir, --port, and --socket options for mysqld. Where applicable, configuration option descriptions indicate the corresponding mysqld startup option.

General Options
  • -DBUILD_CONFIG=mysql_release

    This option configures a source distribution with the same build options used by Oracle to produce binary distributions for official MySQL releases.

  • -DCMAKE_BUILD_TYPE=type

    The type of build to produce:

    • RelWithDebInfo: Enable optimizations and generate debugging information. This is the default MySQL build type.

    • Debug: Disable optimizations and generate debugging information. This build type is also used if the WITH_DEBUG option is enabled. That is, -DWITH_DEBUG=1 has the same effect as -DCMAKE_BUILD_TYPE=Debug.

  • -DCPACK_MONOLITHIC_INSTALL=bool

    This option affects whether the make package operation produces multiple installation package files or a single file. If disabled, the operation produces multiple installation package files, which may be useful if you want to install only a subset of a full MySQL installation. If enabled, it produces a single file for installing everything.

Installation Layout Options

The CMAKE_INSTALL_PREFIX option indicates the base installation directory. Other options with names of the form INSTALL_xxx that indicate component locations are interpreted relative to the prefix and their values are relative pathnames. Their values should not include the prefix.

  • -DCMAKE_INSTALL_PREFIX=dir_name

    The installation base directory.

    This value can be set at server startup with the --basedir option.

  • -DINSTALL_BINDIR=dir_name

    Where to install user programs.

  • -DINSTALL_DOCDIR=dir_name

    Where to install documentation.

  • -DINSTALL_DOCREADMEDIR=dir_name

    Where to install README files.

  • -DINSTALL_INCLUDEDIR=dir_name

    Where to install header files.

  • -DINSTALL_INFODIR=dir_name

    Where to install Info files.

  • -DINSTALL_LAYOUT=name

    Select a predefined installation layout:

    • STANDALONE: Same layout as used for .tar.gz and .zip packages. This is the default.

    • RPM: Layout similar to RPM packages.

    • SVR4: Solaris package layout.

    • DEB: DEB package layout (experimental).

    You can select a predefined layout but modify individual component installation locations by specifying other options. For example:

    shell> cmake . -DINSTALL_LAYOUT=SVR4 -DMYSQL_DATADIR=/var/mysql/data
    
  • -DINSTALL_LIBDIR=dir_name

    Where to install library files.

  • -DINSTALL_MANDIR=dir_name

    Where to install manual pages.

  • -DINSTALL_MYSQLSHAREDIR=dir_name

    Where to install shared data files.

  • -DINSTALL_MYSQLTESTDIR=dir_name

    Where to install the mysql-test directory.

  • -DINSTALL_PLUGINDIR=dir_name

    The location of the plugin directory.

    This value can be set at server startup with the --plugin_dir option.

  • -DINSTALL_SBINDIR=dir_name

    Where to install the mysqld server.

  • -DINSTALL_SCRIPTDIR=dir_name

    Where to install mysql_install_db.

  • -DINSTALL_SHAREDIR=dir_name

    Where to install aclocal/mysql.m4.

  • -DINSTALL_SQLBENCHDIR=dir_name

    Where to install the sql-bench directory. To not install this directory, use an empty value (-DINSTALL_SQLBENCHDIR=).

  • -DINSTALL_SUPPORTFILESDIR=dir_name

    Where to install extra support files.

  • -DMYSQL_DATADIR=dir_name

    The location of the MySQL data directory.

    This value can be set at server startup with the --datadir option.

  • -DSYSCONFDIR=dir_name

    The default my.cnf option file directory.

    This location cannot be set at server startup, but you can start the server with a given option file using the --defaults-file=file_name option, where file_name is the full path name to the file.

  • -DODBC_INCLUDES=dir_name

    The location of the ODBC includes directory, and may be used while configuring Connector/ODBC.

  • -DODBC_LIB_DIR=dir_name

    The location of the ODBC library directory, and may be used while configuring Connector/ODBC.

Storage Engine Options

Storage engines are built as plugins. You can build a plugin as a static module (compiled into the server) or a dynamic module (built as a dynamic library that must be installed into the server using the INSTALL PLUGIN statement or the --plugin-load option before it can be used). Some plugins might not support static or dynamic building.

The MyISAM, MERGE, MEMORY, and CSV engines are mandatory (always compiled into the server) and need not be installed explicitly.

To compile a storage engine statically into the server, use -DWITH_engine_STORAGE_ENGINE=1. Some permissible engine values are ARCHIVE, BLACKHOLE, EXAMPLE, FEDERATED, INNOBASE (InnoDB), PARTITION (partitioning support), and PERFSCHEMA (Performance Schema). Examples:

-DWITH_INNOBASE_STORAGE_ENGINE=1
-DWITH_ARCHIVE_STORAGE_ENGINE=1
-DWITH_BLACKHOLE_STORAGE_ENGINE=1
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1

To exclude a storage engine from the build, use -DWITHOUT_engine_STORAGE_ENGINE=1. Examples:

-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1
-DWITHOUT_FEDERATED_STORAGE_ENGINE=1
-DWITHOUT_PARTITION_STORAGE_ENGINE=1

If neither -DWITH_engine_STORAGE_ENGINE nor -DWITHOUT_engine_STORAGE_ENGINE are specified for a given storage engine, the engine is built as a shared module, or excluded if it cannot be built as a shared module.

Feature Options
  • -DCOMPILATION_COMMENT=string

    A descriptive comment about the compilation environment.

  • -DDEFAULT_CHARSET=charset_name

    The server character set. By default, MySQL uses the latin1 (cp1252 West European) character set.

    charset_name may be one of binary, 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 the cmake/character_sets.cmake file as the value of CHARSETS_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 uses latin1_swedish_ci. Use the SHOW 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.

  • -DENABLE_DEBUG_SYNC=bool

    Whether to compile the Debug Sync facility into the server. This facility is used for testing and debugging. This option is enabled by default, but has no effect unless MySQL is configured with debugging enabled. If debugging is enabled and you want to disable Debug Sync, use -DENABLE_DEBUG_SYNC=0.

    When compiled in, Debug Sync is disabled by default at runtime. To enable it, start mysqld 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.

    For a description of the Debug Sync facility and how to use synchronization points, see MySQL Internals: Test Synchronization.

  • -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, wee Section 5.7, “Tracing mysqld Using DTrace”

  • -DENABLE_GCOV=bool

    Whether to include gcov support (Linux only).

  • -DENABLE_GPROF=bool

    Whether to enable gprof (optimized Linux builds only). This option was added in MySQL 5.6.6.

  • -DENABLED_LOCAL_INFILE=bool

    Whether to enable LOCAL capability in the client library for LOAD DATA INFILE.

    This option controls client-side LOCAL capability, but the capability can be set on the server side at server startup with the --local-infile option. See Section 6.1.6, “Security Issues with LOAD DATA LOCAL.

  • -DENABLED_PROFILING=bool

    Whether to enable query profiling code (for the SHOW PROFILE and SHOW PROFILES statements).

  • -DMYSQL_MAINTAINER_MODE=bool

    Whether to enable a MySQL maintainer-specific development environment. If enabled, this option causes compiler warnings to become errors.

  • -DMYSQL_PROJECT_NAME=name

    For Windows or Mac OS X, the project name to incorporate into the project file name. This option was added in MySQL 5.6.5.

  • -DMYSQL_TCP_PORT=port_num

    The port number on 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.

  • -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.

  • -DWITH_DEFAULT_COMPILER_OPTIONS=bool

    Whether to use the flags from cmake/build_configurations/compiler_options.cmake. This option was added in MySQL 5.6.6.

  • -DWITH_DEFAULT_FEATURE_SET=bool

    Whether to use the flags from cmake/build_configurations/feature_set.cmake. This option was added in MySQL 5.6.6.

  • -DWITH_EMBEDDED_SERVER=bool

    Whether to build the libmysqld embedded server library.

  • -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_LIBWRAP=bool

    Whether to include libwrap (TCP wrappers) support.

  • -DWITH_READLINE=bool

    Whether to use the readline library bundled with the distribution. This option was removed in MySQL 5.6.5 because readline is no longer bundled.

  • -DWITH_SSL=ssl_type

    The type of SSL support to include, if any:

    • no: No SSL support. This is the default before MySQL 5.6.6. As of 5.6.6, this is no longer a permitted value and the default is bundled.

    • yes: Use the system SSL library if present, else the library bundled with the distribution.

    • bundled: Use the SSL library bundled with the distribution. This is the default as of MySQL 5.6.6.

    • system: Use the system SSL library.

    • path_name: As of MySQL 5.6.7, it is permitted to specify the path name to the OpenSSL installation to use. This can be useful instead of a value of system when CMake detects an older or incorrect installed OpenSSL version. (Another permitted way to do the same thing is to set the CMAKE_PREFIX_PATH option to path_name.)

    For information about using SSL support, see Section 6.3.9, “Using SSL for Secure Connections”.

  • -DWITH_ZLIB=zlib_type

    Some features require that the server be built with compression library support, such as the COMPRESS() and UNCOMPRESS() functions, and compression of the client/server protocol. The WITH_ZLIB indicates the source of zlib support:

    • bundled: Use the zlib library bundled with the distribution.

    • system: Use the system zlib library. This is the default.

  • -DWITH_UNIXODBC=1

    Enables unixODBC support, for Connector/ODBC.

Compiler Flags

To specify compiler flags, set the CFLAGS and CXXFLAGS environment variables before running CMake. Example:

shell> CFLAGS=-DHAVE_EMBEDDED_PRIVILEGE_CONTROL
shell> CXXFLAGS=-DHAVE_EMBEDDED_PRIVILEGE_CONTROL
shell> export CFLAGS CXXFLAGS
shell> cmake [options]

The following flags control configuration features:

  • HAVE_EMBEDDED_PRIVILEGE_CONTROL

    By default, authentication for connections to the embedded server is disabled. To enable connection authentication, define this flag.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值