mysql编译选项_MYSQL编译参数详解

本文详细介绍了MySQL的编译选项,包括安装目录设置、程序名称控制、系统类型选择及各种可选特性与包的配置,如--prefix用于指定安装路径,--enable-thread-safe-client开启线程安全客户端编译等,帮助用户自定义编译过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Installation directories:

--prefix=PREFIX         install architecture-independent files in PREFIX

[/usr/local]

--exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX

[PREFIX]

默认情况下,使用make install将会安装所有文件到/usr/local/bin,/usr/local/lib等目录下,您可以使用--prefix指定一个/usr/local以外的安装目录'

为了更好的控制,使用下列选项来更好的设置安装目录

--bindir=DIR            用户可执行文件目录 [EPREFIX/bin]

--sbindir=DIR           系统管理员可执行文件目录 [EPREFIX/sbin]

--libexecdir=DIR        程序的可执行文件目录 [EPREFIX/libexec]

--sysconfdir=DIR        read-only single-machine data [PREFIX/etc]

--sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]

--localstatedir=DIR     日志文件目录 [PREFIX/var]

--libdir=DIR            object code libraries [EPREFIX/lib]

--includedir=DIR        C header files [PREFIX/include]

--oldincludedir=DIR     C header files for non-gcc [/usr/include]

--datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]

--datadir=DIR           read-only architecture-independent data [DATAROOTDIR]

--infodir=DIR           info documentation [DATAROOTDIR/info]

--localedir=DIR         locale-dependent data [DATAROOTDIR/locale]

--mandir=DIR            man documentation [DATAROOTDIR/man]

--docdir=DIR            documentation root [DATAROOTDIR/doc/mysql]

--htmldir=DIR           html documentation [DOCDIR]

--dvidir=DIR            dvi documentation [DOCDIR]

--pdfdir=DIR            pdf documentation [DOCDIR]

--psdir=DIR             ps documentation [DOCDIR]

Program names:

--program-prefix=PREFIX            prepend PREFIX to installed program names

--program-suffix=SUFFIX            append SUFFIX to installed program names

--program-transform-name=PROGRAM   run sed PROGRAM on installed program names

System types:

--build=BUILD     configure for building on BUILD [guessed]

--host=HOST       cross-compile to build programs to run on HOST [BUILD]

--target=TARGET   configure for building compilers for TARGET [HOST]

Optional Features:

--disable-option-checking  ignore unrecognized --enable/--with options

--disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)

--enable-FEATURE[=ARG]  include FEATURE [ARG=yes]

--enable-shared[=PKGS]  build shared libraries [default=yes]

--enable-static[=PKGS]  编译静态链接程序 [default=yes]

--enable-fast-install[=PKGS]

optimize for fast installation [default=yes]

--disable-dependency-tracking  speeds up one-time build

--enable-dependency-tracking   do not reject slow dependency extractors

--disable-libtool-lock  avoid locking (might break parallel builds)

--enable-dtrace         Build with support for the DTRACE.

--disable-thread-safe-client

不以线程方式编译客户端

--enable-thread-safe-client

以线程方式编译客户端

--enable-assembler      Use assembler versions of some string

functions if available.

--enable-profiling      Enable profiling of query lifetime.

--enable-local-infile   Enable LOAD DATA LOCAL INFILE (default: disabled)

--disable-grant-options Disables the use of --init-file, --skip-grant-tables and --bootstrap options

--disable-largefile     Omit support for large files

--enable-debug-sync     Build a version with Debug Sync Facility

Optional Packages:

--with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]

--without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)

--with-pic              try to use only PIC/non-PIC objects [default=use

both]

--with-gnu-ld           assume the C compiler uses GNU ld [default=no]

--with-charset=CHARSET

Default character set, use 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

--with-collation=COLLATION

Default collation

--with-extra-charsets=CHARSET,CHARSET,...

Use charsets in addition to default (none, complex,

all, or a list selected from the above sets)

--without-uca           Skip building of the national Unicode collations.

--with-system-type      Set the system type, like "sun-solaris10"

--with-machine-type     Set the machine type, like "powerpc"

--with-darwin-mwcc      Use Metrowerks CodeWarrior wrappers on OS X/Darwin

--with-other-libc=DIR   Link against libc and other standard libraries

installed in the specified non-standard location

overriding default. Originally added to be able to

link against glibc 2.2 without making the user

upgrade the standard libc installation.

--with-server-suffix    给MySQL加个后缀名,在用mysql登录的时候在版本号的后面可以看到

--with-pthread          Force use of pthread library.

--with-named-thread-libs=ARG

Use specified thread libraries instead of

those automatically found by configure.

--with-named-curses-libs=ARG

Use specified curses libraries instead of

those automatically found by configure.

--with-unix-socket-path=SOCKET

MySQL的套接字位置,使用unix套接字链接提高7.5%性能

--with-tcp-port=port-number

指定MySQL实例将监听TCP端口(默认3306)

--with-mysqld-user=username

What user the mysqld daemon shall be run as.

--with-zlib-dir=no|bundled|DIR

Provide MySQL with a custom location of compression

library. Given DIR, zlib binary is assumed to be in

$DIR/lib and header files in $DIR/include.

--with-libwrap=DIR      Compile in libwrap (tcp_wrappers) support

--with-pstack           Use the pstack backtrace library

--with-debug            增加调试代码

--with-debug=full       增加调试代码 (添加内存检查,很慢)

--without-debug         去除诊断模式,如果用--with-debug=full编译,大多数查询慢20%

--with-error-inject     Enable error injection in MySQL Server

--with-fast-mutexes     Compile with fast mutexes (default is disabled)

--with-atomic-ops=rwlocks|smp|up

Implement atomic operations using pthread rwlocks or

atomic CPU instructions for multi-processor

(default) or uniprocessor configuration

--with-mysqld-ldflags   Extra linking arguments for mysqld

--with-client-ldflags   Extra linking arguments for clients

--with-mysqld-libs   Extra libraries to link with for mysqld

--with-lib-ccflags      Extra CC options for libraries

--with-low-memory       Try to use less memory to compile to avoid

memory limitations.

--with-comment          Comment about compilation environment.

--with-big-tables       大表支持(超过4 G rows even on 32bit platforms)

--with-max-indexes=N    Sets the maximum number of indexes per table,

default 64

--with-ssl=DIR    Include SSL support

--with-plugins=PLUGIN[[[,PLUGIN..]]]

Plugins to include in mysqld. (default is: none)

Must be a configuration name or a comma separated

list of plugins.

Available configurations are: none max max-no-ndb

all.

Available plugins are: partition daemon_example

ftexample semisync archive blackhole csv example

federated heap ibmdb2i innobase myisammrg myisam

ndbcluster.

--without-plugin-PLUGIN Disable the named plugin from being built.

Otherwise, for plugins which are not selected for

inclusion in mysqld will be built dynamically (if

supported)

--with-plugin-PLUGIN    Forces the named plugin to be linked into mysqld

statically.

--with-ndb-sci=DIR      Provide MySQL with a custom location of sci library.

Given DIR, sci library is assumed to be in $DIR/lib

and header files in $DIR/include.

--with-ndb-test       Include the NDB Cluster ndbapi test programs

--with-ndb-docs       Include the NDB Cluster ndbapi and mgmapi documentation

--with-ndb-port       Port for NDB Cluster management server

--with-ndb-port-base  Base port for NDB Cluster transporters

--without-ndb-debug   取消导航调试

--with-ndb-ccflags=CFLAGS

Extra CFLAGS for ndb compile

--without-ndb-binlog       Disable ndb binlog

--without-server        如果只编译MySQL客户端库和客户端程序而不是服务器

--with-embedded-server  构建嵌入式MySQL库 (libmysqld.a)

--without-query-cache   Do not build query cache.

--without-geometry      Do not build geometry-related parts.

--with-embedded-privilege-control

Build parts to check user's privileges.

Only affects embedded library.

--without-docs          Skip building of the documentation.

--without-man          Skip building of the man pages.

--without-readline      Use system readline instead of bundled copy.

--without-libedit       Use system libedit instead of bundled copy.

Some influential environment variables:

CC          C compiler command

CFLAGS      C compiler flags

LDFLAGS     linker flags, e.g. -L if you have libraries in a

nonstandard directory

LIBS        libraries to pass to the linker, e.g. -l

CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I if

you have headers in a nonstandard directory

CPP         C preprocessor

CXX         C++ compiler command

CXXFLAGS    C++ compiler flags

CXXCPP      C++ preprocessor

CCAS        assembler compiler command (defaults to CC)

CCASFLAGS   assembler compiler flags (defaults to CFLAGS)

Use these variables to override the choices made by `configure' or to help

it to find libraries and programs with nonstandard names/locations.

Description of plugins:

=== Partition Support ===

Plugin Name:      partition

Description:      MySQL Partitioning Support

Supports build:   static

Configurations:   max, max-no-ndb

=== Daemon Example Plugin ===

Plugin Name:      daemon_example

Description:      This is an example plugin daemon.

Supports build:   dynamic

=== Simple Parser ===

Plugin Name:      ftexample

Description:      Simple full-text parser plugin

Supports build:   dynamic

=== Semi-synchronous Replication Plugin ===

Plugin Name:      semisync

Description:      Semi-synchronous replication plugin.

Supports build:   dynamic

=== Archive Storage Engine ===

Plugin Name:      archive

Description:      Archive Storage Engine

Supports build:   static and dynamic

Configurations:   max, max-no-ndb

=== Blackhole Storage Engine ===

Plugin Name:      blackhole

Description:      Basic Write-only Read-never tables

Supports build:   static and dynamic

Configurations:   max, max-no-ndb

=== CSV Storage Engine ===

Plugin Name:      csv

Description:      Stores tables in text CSV format

Supports build:   static

Status:           mandatory

=== Example Storage Engine ===

Plugin Name:      example

Description:      Example for Storage Engines for developers

Supports build:   dynamic

Configurations:   max, max-no-ndb

=== Federated Storage Engine ===

Plugin Name:      federated

Description:      Connects to tables on remote MySQL servers

Supports build:   static and dynamic

Configurations:   max, max-no-ndb

=== Memory Storage Engine ===

Plugin Name:      heap

Description:      Volatile memory based tables

Supports build:   static

Status:           mandatory

=== IBM DB2 for i Storage Engine ===

Plugin Name:      ibmdb2i

Description:      IBM DB2 for i Storage Engine

Supports build:   dynamic

Configurations:   max, max-no-ndb

=== InnoDB Storage Engine ===

Plugin Name:      innobase

Description:      Transactional Tables using InnoDB

Supports build:   static and dynamic

Configurations:   max, max-no-ndb

=== MyISAM MERGE Engine ===

Plugin Name:      myisammrg

Description:      Merge multiple MySQL tables into one

Supports build:   static

Status:           mandatory

=== MyISAM Storage Engine ===

Plugin Name:      myisam

Description:      Traditional non-transactional MySQL tables

Supports build:   static

Status:           mandatory

=== Cluster Storage Engine ===

Plugin Name:      ndbcluster

Description:      High Availability Clustered tables

Supports build:   static

Configurations:   max

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值