Spec-Zone .ru
спецификации, руководства, описания, API
|
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.13. MySQL Source-Configuration Option Reference(CMake)
Formats | Description | Default | Introduced | Removed |
---|---|---|---|---|
BUILD_CONFIG |
Use same build options as official releases |
|
||
CMAKE_BUILD_TYPE |
Type of build to produce | RelWithDebInfo |
||
CMAKE_INSTALL_PREFIX |
Installation base directory | /usr/local/mysql |
||
COMPILATION_COMMENT |
Comment about compilation environment |
|
||
CPACK_MONOLITHIC_INSTALL |
Whether package build produces single file | OFF |
||
DEFAULT_CHARSET |
The default server character set | latin1 |
||
DEFAULT_COLLATION |
The default server collation | latin1_swedish_ci |
||
ENABLE_DEBUG_SYNC |
Whether to enable Debug Sync support | ON |
||
ENABLE_DOWNLOADS |
Whether to download optional files | OFF |
||
ENABLE_DTRACE |
Whether to include DTrace support |
|
||
ENABLE_GCOV |
Whether to include gcov support |
|
||
ENABLE_GPROF |
Enable gprof (optimized Linux builds only) | OFF |
||
ENABLED_LOCAL_INFILE |
Whether to enable LOCAL for LOAD DATA INFILE | OFF |
||
ENABLED_PROFILING |
Whether to enable query profiling code | ON |
||
IGNORE_AIO_CHECK |
With -DBUILD_CONFIG=mysql_release, ignore libaio check | OFF |
||
INSTALL_BINDIR |
User executables directory | PREFIX/bin |
||
INSTALL_DOCDIR |
Documentation directory | PREFIX/docs |
||
INSTALL_DOCREADMEDIR |
README file directory | PREFIX |
||
INSTALL_INCLUDEDIR |
Header file directory | PREFIX/include |
||
INSTALL_INFODIR |
Info file directory | PREFIX/docs |
||
INSTALL_LAYOUT |
Select predefined installation layout | STANDALONE |
||
INSTALL_LIBDIR |
Library file directory | PREFIX/lib |
||
INSTALL_MANDIR |
Manual page directory | PREFIX/man |
||
INSTALL_MYSQLSHAREDIR |
Shared data directory | PREFIX/share |
||
INSTALL_MYSQLTESTDIR |
mysql-test directory | PREFIX/mysql-test |
||
INSTALL_PLUGINDIR |
Plugin directory | PREFIX/lib/plugin |
||
INSTALL_SBINDIR |
Server executable directory | PREFIX/bin |
||
INSTALL_SCRIPTDIR |
Scripts directory | PREFIX/scripts |
||
INSTALL_SHAREDIR |
aclocal/mysql.m4 installation directory | PREFIX/share |
||
INSTALL_SQLBENCHDIR |
sql-bench directory | PREFIX |
||
INSTALL_SUPPORTFILESDIR |
Extra support files directory | PREFIX/support-files |
||
MAX_INDEXES |
Maximum indexes per table | 64 |
5.7.1 | |
MYSQL_DATADIR |
Data directory |
|
||
MYSQL_MAINTAINER_MODE |
Whether to enable MySQL maintainer-specific development environment | OFF |
||
MYSQL_PROJECT_NAME |
Windows/Mac OS X project name | 3306 |
||
MYSQL_TCP_PORT |
TCP/IP port number | 3306 |
||
MYSQL_UNIX_ADDR |
Unix socket file | /tmp/mysql.sock |
||
ODBC_INCLUDES |
ODBC includes directory |
|
||
ODBC_LIB_DIR |
ODBC library directory |
|
||
OPTIMIZER_TRACE |
Whether to support optimizer tracing |
|
||
SYSCONFDIR |
Option file directory |
|
||
WITH_DEBUG |
Whether to include debugging support | OFF |
||
WITH_DEFAULT_COMPILER_OPTIONS |
Whether to use default compiler options | ON |
||
WITH_DEFAULT_FEATURE_SET |
Whether to use default feature set | ON |
||
WITH_EDITLINE |
Which libedit/editline library to use | bundled |
5.7.2 | |
WITH_EMBEDDED_SERVER |
Whether to build embedded server | OFF |
||
WITH_xxx_STORAGE_ENGINE
|
Compile storage engine xxx statically into server |
|
||
WITH_EXTRA_CHARSETS |
Which extra character sets to include | all |
||
WITH_INNODB_MEMCACHED |
Whether to generate memcached shared libraries. | OFF |
||
WITH_LIBWRAP |
Whether to include libwrap (TCP wrappers) support | OFF |
||
WITH_SSL
|
Type of SSL support | no |
||
WITH_UNIXODBC |
Enable unixODBC support | OFF |
||
WITH_ZLIB
|
Type of zlib support | system |
||
WITHOUT_xxx_STORAGE_ENGINE
|
Exclude 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.
This option configures a source distribution with the same build options used by Oracle to produce binary distributions for official MySQL releases.
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.
The CMAKE_INSTALL_PREFIX
option indicates the base installation directory. Other options with names of the form INSTALL_
that indicate component locations are interpreted
relative to the prefix and their values are relative pathnames. Their values should not include the prefix.xxx
-DCMAKE_INSTALL_PREFIX=
dir_name
The installation base directory.
This value can be set at server startup with the --basedir
option.
Where to install user programs.
Where to install documentation.
-DINSTALL_DOCREADMEDIR=
dir_name
Where to install README
files.
Where to install header files.
Where to install Info files.
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
Where to install library files.
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. As of MySQL 5.7.2, to
suppress installation of this directory, explicitly set the option to the empty value (-DINSTALL_MYSQLTESTDIR=
).
The location of the plugin directory.
This value can be set at server startup with the --plugin_dir
option.
Where to install the mysqld server.
Where to install mysql_install_db.
Where to install aclocal/mysql.m4
.
-DINSTALL_SQLBENCHDIR=
dir_name
Where to install the sql-bench
directory. To suppress installation of
this directory, explicitly set the option to the empty value (-DINSTALL_SQLBENCHDIR=
).
-DINSTALL_SUPPORTFILESDIR=
dir_name
Where to install extra support files.
The location of the MySQL data directory.
This value can be set at server startup with the --datadir
option.
Whether to support optimizer tracing. See
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=
option, where file_name
file_name
is the full path name to the file.
The location of the ODBC includes directory, and may be used while configuring Connector/ODBC.
The location of the ODBC library directory, and may be used while configuring Connector/ODBC.
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_
. Some permissible engine
_STORAGE_ENGINE=1engine
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_
.
Examples: engine
_STORAGE_ENGINE=1
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1-DWITHOUT_FEDERATED_STORAGE_ENGINE=1-DWITHOUT_PARTITION_STORAGE_ENGINE=1
If neither -DWITH_
nor engine
_STORAGE_ENGINE-DWITHOUT_
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.engine
_STORAGE_ENGINE
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.
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=
option, where N
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
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.
Whether to include support for DTrace probes. For information about DTrace, wee Section 5.7, "Tracing mysqld Using DTrace"
Whether to include gcov support (Linux only).
Whether to enable gprof
(optimized Linux builds only).
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
".
Whether to enable query profiling code (for the SHOW PROFILE
and SHOW PROFILES
statements).
If the -DBUILD_CONFIG=mysql_release
option is given on Linux, the libaio
library must be linked in by
default. If you do not have libaio
or do not want to install it, you
can suppress the check for it by specifying -DIGNORE_AIO_CHECK=1
.
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.
Whether to enable a MySQL maintainer-specific development environment. If enabled, this option causes compiler warnings to become errors.
For Windows or Mac OS X, the project name to incorporate into the project file name.
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.
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.
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
.
-DWITH_DEFAULT_FEATURE_SET=
bool
Whether to use the flags from cmake/build_configurations/feature_set.cmake
.
Which libedit
/editline
library to use. The
permitted values are bundled
(the default) and system
.
WITH_EDITLINE
was added in MySQL 5.7.2. It replaces WITH_LIBEDIT
Whether to build the libmysqld
embedded server library.
Which extra character sets to include:
all
: All character sets. This is the
default.
complex
: Complex character sets.
none
: No extra character sets.
-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.
Whether to generate memcached shared libraries (libmemcached.so
and
innodb_engine.so
).
Whether to include libwrap
(TCP wrappers) support.
-DWITH_SSL={
|ssl_type
path_name
}
The type of SSL support to include or the path name to the OpenSSL installation to use.
ssl_type
can be one of the
following values:
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.
system
: Use the system SSL
library.
path_name
is the path name to
the OpenSSL installation to use. Using this can be preferable to using the ssl_type
value of system
, for 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 the CMAKE_PREFIX_PATH
option to path_name
.)
For information about using SSL support, see Section 6.3.9, "Using SSL for Secure Connections".
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.
Enables unixODBC support, for Connector/ODBC.
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: