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 Section 2.21, “Environment Variables”.
The following table shows the available configure options.
Table 2.7 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.0.82|
|Disable dependency tracking|
|Disable GRANT options||5.0.34|
|Omit support for large files|
|Disable libtool lock|
|Build a version without query profiling code||5.0.37||5.0.45|
|Use assembler versions of some string functions if available|
|Do not reject slow dependency extractors|
|Optimize for fast installation|
|Enable LOCAL for LOAD DATA INFILE|
|Build shared libraries|
|Build static libraries|
|Compile the client with threads|
|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|
|Use BerkeleyDB located in DIR|
|Find Berkeley DB headers in DIR|
|Find Berkeley DB libraries in DIR|
|Support tables with more than 4 G rows even on 32 bit platforms||5.0.4|
|Enable the Blackhole Storage Engine||5.0.4|
|Default character set|
|Extra linking arguments for clients|
|Comment about compilation environment|
|Enable the CSV Storage Engine|
|Use Metrowerks CodeWarrior wrappers on OS X/Darwin||5.0.6|
|Build parts to check user's privileges (only affects embedded library)|
|Build the embedded server|
|Enable the Example Storage Engine|
|Use charsets in addition to default|
|Assume the C compiler uses GNU ld|
|Enable the ISAM table type||5.0.2|
|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"||5.0.44|
|Sets the maximum number of indexes per table|
|Always use included thread lib||5.0.4|
|Extra linking arguments for mysqld|
|Extra libraries to link with for mysqld||5.0.44|
|What user the mysqld daemon shall be run as|
|Include the corba-based MySQL file system||5.0.3|
|Build the mysqlmanager binary|
|Use specified curses libraries|
|Use specified thread libraries|
|Extra CC options for ndb compile||5.0.3|
|Include the NDB Cluster ndbapi and mgmapi documentation|
|Port for NDB Cluster management server|
|Port for NDB Cluster management server||5.0.3|
|Provide MySQL with a custom location of sci library|
|Include the NDB Cluster shared memory transporter||5.0.2|
|Include the NDB Cluster ndbapi test programs|
|Include the NDB Cluster table handler|
|Include the OpenSSL support|
|Find OpenSSL headers in DIR|
|Find OpenSSL libraries in DIR|
|Link against libc and other standard libraries installed in the specified nonstandard location|
|Try to use only PIC/non-PIC objects|
|Use the pstack backtrace library|
|Force use of pthread library|
|Enable RAID Support||5.0.3|
|Append value to the version string|
|Set the system type, like "sun-solaris10"||5.0.44|
|Include additional configurations|
|Which port to use for MySQL services|
|Where to put the unix-domain socket|
|Include the Virtual IO support||5.0.2|
|Include the yaSSL support||5.0.6|
|Provide MySQL with a custom location of compression library|
|Do not use PACKAGE|
|Skip building of the benchmark suite|
|Build a production version without debugging code|
|Skip building of the documentation|
|Skip building utilities in the tools directory|
|Do not build geometry-related parts|
|Do not include the InnoDB table handler||5.0.48|
|Use system libedit instead of bundled copy|
|Skip building of the man pages|
|Disable special ndb debug features||5.0.3|
|Do not build query cache|
|Use system readline instead of bundled copy|
|Only build the client|
|Skip building of the national Unicode collations||5.0.3|
Some of the configure options available are described here. For options that may be of use if you have difficulties building MySQL, see Section 2.17.4, “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 Section 4.2.6, “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 Section B.5.3.6, “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.
The following list indicates some compilers and environment variable settings that are commonly used with each one.
CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors"
CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro \ -felide-constructors -fno-exceptions -fno-rtti"
In most cases, you can get a reasonably optimized MySQL binary by using the options from the preceding list and adding the following options to 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 Section 2.16, “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 Section 10.1.4, “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 Section 21.3, “Debugging and Porting MySQL”.
As of MySQL 5.0.25, 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.
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 Section 188.8.131.52, “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
--with-big-tablesoption, beginning with MySQL 5.0.4.
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.0.34.
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.0.82.
In MySQL Community Server, this option enables the statement profiling capability exposed by the
SHOW PROFILESstatements. (See Section 184.108.40.206, “SHOW PROFILES Syntax”.) The option was added in MySQL 5.0.37.
See Section 2.20, “Operating System-Specific Notes”, for options that pertain to particular operating systems.
See Section 220.127.116.11, “Building MySQL with SSL Support”, for options that pertain to configuring MySQL to support secure (encrypted) connections.