The configure script provides a great deal of control over how you configure a MySQL source distribution. Typically, you do this using options on the configure command line. For a full list of options supported by configure, run this command:
You can also affect configure using certain environment variables. See Environment Variables.
The following table shows the available configure options.
Table 4.1 MySQL Source-Configuration Option Reference (configure)
|Configure for building on BUILD|
|Cache test results in FILE|
|Alias for `--cache-file=config.cache'|
|Read-only architecture-independent data|
|Do not include FEATURE|
|Disable additional features provided by the community||5.1.28|
|Disable dependency tracking|
|Disable GRANT options|
|Omit support for large files|
|Disable libtool lock|
|Compile the client without threads||5.1.7|
|Use assembler versions of some string functions if available|
|Compile in Debug Sync facility||5.1.41|
|Do not reject slow dependency extractors|
|Optimize for fast installation|
|Enable LOCAL for LOAD DATA INFILE|
|Build a version with query profiling code||5.1.24|
|Build shared libraries|
|Build static libraries|
|Compile the client with threads||5.1.6|
|Install architecture-dependent files in EPREFIX|
|Display help message and exit|
|Cross-compile to build programs to run on HOST|
|C header files|
|Object code libraries|
|Modifiable single-machine data|
|Do not create output files|
|C header files for non-gcc|
|Install architecture-independent files in PREFIX|
|Prepend PREFIX to installed program names|
|Append SUFFIX to installed program names|
|run sed PROGRAM on installed program names|
|Do not print `checking...' messages|
|System administrative executables|
|Modifiable architecture-independent data|
|Find the sources in DIR|
|Read-only single-machine data|
|Configure for building compilers for TARGET|
|Display version information and exit|
|Enable the Archive Storage Engine||5.1.9|
|Implement atomic operations using pthread rwlocks or atomic CPU instructions for multi-processor||5.1.12|
|Use BerkeleyDB located in DIR||5.1.11|
|Find Berkeley DB headers in DIR||5.1.11|
|Find Berkeley DB libraries in DIR||5.1.11|
|Support tables with more than 4 G rows even on 32 bit platforms|
|Enable the Blackhole Storage Engine||5.1.9|
|Default character set|
|Extra linking arguments for clients|
|Comment about compilation environment|
|Enable the CSV Storage Engine||5.1.9|
|Use Metrowerks CodeWarrior wrappers on OS X/Darwin|
|Add debug code (optionally with memory checker, very slow)||5.1.7|
|Build parts to check user's privileges (only affects embedded library)|
|Build the embedded server|
|Enable error injection in MySQL Server||5.1.11|
|Enable the Example Storage Engine||5.1.9|
|Use charsets in addition to default|
|Compile with fast mutexes||5.1.5|
|Enable federated storage engine||5.1.3||5.1.9|
|Assume the C compiler uses GNU ld|
|Enable innobase storage engine||5.1.3||5.1.9|
|Extra CC options for libraries|
|Compile in libwrap (tcp_wrappers) support|
|Try to use less memory to compile to avoid memory limitations|
|Set the machine type, like "powerpc"|
|Make the temporary tables within MySQL use the Maria storage engine||5.1.24|
|Sets the maximum number of indexes per table|
|Extra linking arguments for mysqld|
|Extra libraries to link with for mysqld|
|What user the mysqld daemon shall be run as|
|Build the mysqlmanager binary|
|Use specified curses libraries|
|Use specified thread libraries|
|Extra CC options for ndb compile|
|Include the NDB Cluster ndbapi and mgmapi documentation|
|Port for NDB Cluster management server|
|Port for NDB Cluster management server|
|Provide MySQL with a custom location of sci library|
|Include the NDB Cluster ndbapi test programs|
|Include the NDB Cluster table handler||5.1.9|
|Include the OpenSSL support||5.1.9|
|Find OpenSSL headers in DIR||5.1.9|
|Find OpenSSL libraries in DIR||5.1.9|
|Link against libc and other standard libraries installed in the specified nonstandard location|
|Try to use only PIC/non-PIC objects|
|Forces the named plugin to be linked into mysqld statically||5.1.11|
|Plugins to include in mysqld||5.1.11|
|Use the pstack backtrace library||5.1.54|
|Force use of pthread library|
|Include row-based replication||5.1.5||5.1.6|
|Append value to the version string|
|Include SSL support||5.1.11|
|Set the system type, like "sun-solaris10"|
|Include additional configurations|
|Which port to use for MySQL services|
|Where to put the unix-domain socket|
|Include the yaSSL support||5.1.9|
|Provide MySQL with a custom location of compression library|
|Do not use PACKAGE|
|Skip building of the benchmark suite||5.1.11|
|Build a production version without debugging code||5.1.6|
|Skip building of the documentation|
|Skip building utilities in the tools directory||5.1.9|
|Do not build geometry-related parts|
|Use system libedit instead of bundled copy|
|Skip building of the man pages|
|Disable ndb binlog||5.1.6|
|Disable special ndb debug features|
|Do not build query cache|
|Use system readline instead of bundled copy|
|Don't include row-based replication||5.1.7||5.1.14|
|Only build the client|
|Skip building of the national Unicode collations|
If you are using a version of gcc recent enough
to understand the
-fno-exceptions option, it is
very important that you use this option.
Otherwise, you may compile a binary that crashes randomly. Also
-fno-rtti along with
-fno-exceptions. When in doubt, do the following:
CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors \ -fno-exceptions -fno-rtti" ./configure \ --prefix=/usr/local/mysql --enable-assembler \ --with-mysqld-ldflags=-all-static
On most systems, this gives you a fast and stable binary.
When compiling from source, you should also be aware of any platform specific considerations that may influence and impact the build process. Knowing and applying this information will help to ensure you get the best performance and most stable binary for your chosen platform. For more information, use the following sections:
Some of the configure options available are described here. For options that may be of use if you have difficulties building MySQL, see Chapter 5, Dealing with Problems Compiling MySQL.
Many options configure compile-time defaults that can be
overridden at server startup. For example, the
that configure the default installation base directory location,
TCP/IP port number, and Unix socket file can be changed at server
startup with the
--socket options for
To compile just the MySQL client libraries and client programs and not the server, use the
If you have no C++ compiler, some client programs such as mysql cannot be compiled because they require C++. In this case, you can remove the code in configure that tests for the C++ compiler and then run ./configure with the
--without-serveroption. The compile step should still try to build all clients, but you can ignore any warnings about files such as
mysql.cc. (If make stops, try make -k to tell it to continue with the rest of the build even if errors occur.)
To build the embedded MySQL library (
libmysqld.a), use the
./configure --prefix=/usr/local \
The first command changes the installation prefix so that everything is installed under
/usr/local/mysqlrather than the default of
/usr/local. The second command preserves the default installation prefix, but overrides the default location for database directories (normally
/usr/local/var) and changes it to
You can also specify the installation directory and data directory locations at server startup time by using the
--datadiroptions. These can be given on the command line or in an MySQL option file, although it is more common to use an option file. See Using Option Files.
--with-tcp-portoption specifies the port number on which the server listens for TCP/IP connections. The default is port 3306. To listen on a different port, use a configure command like this:
The socket file name must be an absolute path name. You can also change the location of
mysql.sockat server startup by using a MySQL option file. See How to Protect or Change the MySQL Unix Socket File.
To compile statically linked programs (for example, to make a binary distribution, to get better performance, or to work around problems with some Red Hat Linux distributions), run configure like this:
./configure --with-client-ldflags=-all-static \
CC=gcc CXX=gcc ./configure
When you use gcc as your C++ compiler, it does not attempt to link in
libstdc++. This may be a good thing to do even if you have those libraries installed. Some versions of them have caused strange problems for MySQL users in the past.
In most cases, you can get a reasonably optimized MySQL binary by using the following options on the configure line:
--prefix=/usr/local/mysql --enable-assembler \ --with-mysqld-ldflags=-all-static
The full configure line would, in other words, be something like the following for all recent gcc versions:
CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro \ -felide-constructors -fno-exceptions -fno-rtti" ./configure \ --prefix=/usr/local/mysql --enable-assembler \ --with-mysqld-ldflags=-all-static
The binaries we provide on the MySQL Web site at http://dev.mysql.com/downloads/ are all compiled with full optimization and should work well for most users. See Installing MySQL on Unix/Linux Using Generic Binaries.
If the build fails and produces errors about your compiler or linker not being able to create the shared library
Nis a version number), you can work around this problem by giving the
--disable-sharedoption to configure. In this case, configure does not build a shared
By default, MySQL uses the
latin1(cp1252 West European) character set. To change the default set, use the
CHARSETmay be one of
utf8. (Additional character sets might be available. Check the output from ./configure --help for the current list.)
The default collation may also be specified. MySQL uses the
latin1_swedish_cicollation by default. To change this, use the
To change both the character set and the collation, use both the
--with-collationoptions. The collation must be a legal collation for the character set. (Use the
SHOW COLLATIONstatement to determine which collations are available for each character set.)
With the configure option
--with-extra-charsets=, you can define which additional character sets should be compiled into the server.
LISTis one of the following:
A list of character set names separated by spaces
complexto include all character sets that can't be dynamically loaded
allto include all character sets into the binaries
Clients that want to convert characters between the server and the client should use the
SET NAMESstatement. See Connection Character Sets and Collations.
To configure MySQL with debugging code, use the
This causes a safe memory allocator to be included that can find some errors and that provides output about what is happening. See Debugging and Porting MySQL.
As of MySQL 5.1.12, using
--with-debugto configure 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.
To cause the Debug Sync facility to be compiled into the server, use the
--enable-debug-syncoption. This facility is used for testing and debugging. When compiled in, Debug Sync is disabled by default at runtime. To enable it, start mysqld with the
Nis a timeout value greater than 0. (The default value is 0, which disables Debug Sync.)
Nbecomes 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.
If your client programs are using threads, you must compile a thread-safe version of the MySQL client library with the
--enable-thread-safe-clientconfigure option. This creates a
libmysqlclient_rlibrary with which you should link your threaded applications. See Writing C API Threaded Client Programs.
Some features require that the server be built with compression library support, such as the
UNCOMPRESS()functions, and compression of the client/server protocol. The
--with-zlib-dir=no|bundled|option provides control over compression library support. The value
noexplicitly disables compression support.
zliblibrary bundled in the MySQL sources to be used. A
DIRpath name specifies the directory in which to find the compression library sources.
It is possible to build MySQL with large table support using the
This option causes the variables that store table row counts to be declared as
unsigned long longrather than
unsigned long. This enables tables to hold up to approximately 1.844E+19 ((232)2) rows rather than 232 (~4.295E+09) rows. Previously it was necessary to pass
-DBIG_TABLESto the compiler manually in order to enable this feature.
Run configure with the
--disable-grant-optionsoption to cause the
--init-fileoptions for mysqld to be disabled. For Windows, the configure.js script recognizes the
DISABLE_GRANT_OPTIONSflag, which has the same effect. The capability is available as of MySQL 5.1.15.
This option allows MySQL Community Server features to be enabled. Additional options may be required for individual features, such as
--enable-profilingto enable statement profiling. This option was added in MySQL 5.1.24. It is enabled by default as of MySQL 5.1.28; to disable it, use
When given with
--enable-profilingoption enables the statement profiling capability exposed by the
SHOW PROFILESstatements. (See SHOW PROFILES Syntax.) This option was added in MySQL 5.1.24. It is enabled by default as of MySQL 5.1.28; to disable it, use
See General Installation Guidance, for options that pertain to particular operating systems.
See Building MySQL with Support for Secure Connections, for options that pertain to configuring MySQL to support secure (encrypted) connections.
PLUGINis an individual plugin name such as
GROUPis a configuration group name such as
none(select no plugins) or
all(select all plugins).
You can build a plugin as static (compiled into the server) or dynamic (built as a dynamic library that must be installed using the
INSTALL PLUGINstatement or the
--plugin-loadoption before it can be used). Some plugins might not support static or dynamic build.
configure --help shows the following information pertaining to plugins:
The plugin-related options
The names of all available plugins
For each plugin, a description of its purpose, which build types it supports (static or dynamic), and which plugin groups it is a part of.
--with-pluginscan take a list of one or more plugin names separated by commas, or a plugin group name. The named plugins are configured to be built as static plugins.
--with-plugin-configures the given plugin to be built as a static plugin.
--without-plugin-disables the given plugin from being built.
If a plugin is named both with a
--withoutoption, the result is undefined.
For any plugin that is not explicitly selected or disabled, it is selected to be built dynamically if it supports dynamic build, and not built if it does not support dynamic build. (Thus, in the case that no plugin options are given, all plugins that support dynamic build are selected to be built as dynamic plugins. Plugins that do not support dynamic build are not built.)