2.11.4 MySQL Source-Configuration Options

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:

shell> ./configure --help

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

The following table shows the available configure options.

Table 2.20 MySQL Source-Configuration Option Reference (configure)

FormatsDescriptionDefaultIntroducedRemoved
--bindir=DIRUser executablesEPREFIX/bin  
--build=BUILDConfigure for building on BUILDguessed  
--cache-file=FILECache test results in FILEdisabled  
-CAlias for `--cache-file=config.cache'  
--config-cache    
--datadir=DIRRead-only architecture-independent dataPREFIX/share  
--disable-FEATUREDo not include FEATURE  
--disable-community-featuresDisable additional features provided by the community5.1.28 
--disable-dependency-trackingDisable dependency tracking  
--disable-grant-optionsDisable GRANT options  
--disable-largefileOmit support for large files  
--disable-libtool-lockDisable libtool lock  
--disable-thread-safe-clientCompile the client without threads5.1.7 
--enable-FEATUREEnable FEATURE  
--enable-assemblerUse assembler versions of some string functions if available  
--enable-debug-syncCompile in Debug Sync facility5.1.41 
--enable-dependency-trackingDo not reject slow dependency extractors  
--enable-fast-installOptimize for fast installationyes  
--enable-local-infileEnable LOCAL for LOAD DATA INFILEdisabled  
--enable-profilingBuild a version with query profiling code5.1.24 
--enable-sharedBuild shared librariesyes  
--enable-staticBuild static librariesyes  
--enable-thread-safe-clientCompile the client with threads 5.1.6
--exec-prefix=EPREFIXInstall architecture-dependent files in EPREFIX  
-hDisplay this help and exit  
--help    
--help=shortDisplay options specific to this package   
--help=recursiveDisplay the short help of all the included packages   
--host=HOSTCross-compile to build programs to run on HOST  
--includedir=DIRC header filesPREFIX/include  
--infodir=DIRInfo documentationPREFIX/info  
--libdir=DIRObject code librariesEPREFIX/lib  
--libexecdir=DIRProgram executablesEPREFIX/libexec  
--localstatedir=DIRModifiable single-machine dataPREFIX/var  
--mandir=DIRman documentationPREFIX/man  
-nDo not create output files  
--no-create    
--oldincludedir=DIRC header files for non-gcc/usr/include  
--prefix=PREFIXInstall architecture-independent files in PREFIX  
--program-prefix=PREFIXPrepend PREFIX to installed program names  
--program-suffix=SUFFIXAppend SUFFIX to installed program names  
--program-transform-name=PROGRAMrun sed PROGRAM on installed program names  
-qDo not print `checking...' messages  
--quiet    
--sbindir=DIRSystem administrative executablesEPREFIX/sbin  
--sharedstatedir=DIRModifiable architecture-independent dataPREFIX/com  
--srcdir=DIRFind the sources in DIRconfigure directory or ..  
--sysconfdir=DIRRead-only single-machine dataPREFIX/etc  
--target=TARGETConfigure for building compilers for TARGET  
-VDisplay version information and exit  
--version    
--with-PACKAGEUse PACKAGE  
--with-archive-storage-engineEnable the Archive Storage Engineno 5.1.9
--with-atomic-opsImplement atomic operations using pthread rwlocks or atomic CPU instructions for multi-processor5.1.12 
--with-berkeley-dbUse BerkeleyDB located in DIRno 5.1.11
--with-berkeley-db-includesFind Berkeley DB headers in DIR 5.1.11
--with-berkeley-db-libsFind Berkeley DB libraries in DIR 5.1.11
--with-big-tablesSupport tables with more than 4 G rows even on 32 bit platforms  
--with-blackhole-storage-engineEnable the Blackhole Storage Engineno 5.1.9
--with-charsetDefault character set  
--with-client-ldflagsExtra linking arguments for clients  
--with-collationDefault collation  
--with-commentComment about compilation environment  
--with-csv-storage-engineEnable the CSV Storage Engineyes 5.1.9
--with-darwin-mwccUse Metrowerks CodeWarrior wrappers on OS X/Darwin  
--with-debugAdd debug code5.1.7 
--with-debug=fullAdd debug code (adds memory checker, very slow)   
--with-embedded-privilege-controlBuild parts to check user's privileges (only affects embedded library)  
--with-embedded-serverBuild the embedded server  
--with-error-injectEnable error injection in MySQL Server5.1.11 
--with-example-storage-engineEnable the Example Storage Engineno 5.1.9
--with-extra-charsetsUse charsets in addition to default  
--with-fast-mutexesCompile with fast mutexesenabled5.1.5 
--with-federated-storage-engineEnable federated storage engineno5.1.35.1.9
--with-gnu-ldAssume the C compiler uses GNU ldno  
--with-innodbEnable innobase storage engineno5.1.35.1.9
--with-lib-ccflagsExtra CC options for libraries  
--with-libwrap=DIRCompile in libwrap (tcp_wrappers) support  
--with-low-memoryTry to use less memory to compile to avoid memory limitations  
--with-machine-typeSet the machine type, like "powerpc"  
--with-max-indexes=NSets the maximum number of indexes per table64  
--with-mysqld-ldflagsExtra linking arguments for mysqld  
--with-mysqld-libsExtra libraries to link with for mysqld  
--with-mysqld-userWhat user the mysqld daemon shall be run as  
--with-mysqlmanagerBuild the mysqlmanager binaryBuild if server is built  
--with-named-curses-libsUse specified curses libraries  
--with-named-thread-libsUse specified thread libraries  
--with-ndb-ccflagsExtra CC options for ndb compile  
--with-ndb-docsInclude the NDB Cluster ndbapi and mgmapi documentation  
--with-ndb-portPort for NDB Cluster management server  
--with-ndb-port-basePort for NDB Cluster management server  
--with-ndb-sci=DIRProvide MySQL with a custom location of sci library  
--with-ndb-testInclude the NDB Cluster ndbapi test programs  
--with-ndbclusterInclude the NDB Cluster table handlerno 5.1.9
--with-openssl=DIRInclude the OpenSSL support 5.1.9
--with-openssl-includesFind OpenSSL headers in DIR 5.1.9
--with-openssl-libsFind OpenSSL libraries in DIR 5.1.9
--with-other-libc=DIRLink against libc and other standard libraries installed in the specified nonstandard location  
--with-picTry to use only PIC/non-PIC objectsUse both  
--with-plugin-PLUGINForces the named plugin to be linked into mysqld statically5.1.11 
--with-pluginsPlugins to include in mysqldnone5.1.11 
--with-pstackUse the pstack backtrace library 5.1.54
--with-pthreadForce use of pthread library  
--with-row-based-replicationInclude row-based replication5.1.55.1.6
--with-server-suffixAppend value to the version string  
--with-ssl=DIRInclude SSL support5.1.11 
--with-system-typeSet the system type, like "sun-solaris10"  
--with-tagsInclude additional configurationsautomatic  
--with-tcp-portWhich port to use for MySQL services3306  
--with-unix-socket-pathWhere to put the unix-domain socket  
--with-yasslInclude the yaSSL support 5.1.9
--with-zlib-dir=no|bundled|DIRProvide MySQL with a custom location of compression library  
--without-PACKAGEDo not use PACKAGE  
--without-benchSkip building of the benchmark suite 5.1.11
--without-debugBuild a production version without debugging code 5.1.6
--without-docsSkip building of the documentation  
--without-extra-toolsSkip building utilities in the tools directory 5.1.9
--without-geometryDo not build geometry-related parts  
--without-libeditUse system libedit instead of bundled copy  
--without-manSkip building of the man pages  
--without-ndb-binlogDisable ndb binlog5.1.6 
--without-ndb-debugDisable special ndb debug features  
--without-plugin-PLUGINExclude PLUGIN5.1.11 
--without-query-cacheDo not build query cache  
--without-readlineUse system readline instead of bundled copy  
--without-row-based-replicationDon't include row-based replication5.1.75.1.14
--without-serverOnly build the client  
--without-ucaSkip 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 use -felide-constructors and -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 Section 2.11.5, “Dealing with Problems Compiling MySQL”.

Many options configure compile-time defaults that can be overridden at server startup. For example, the --prefix, --with-tcp-port, and with-unix-socket-path 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.