MYSQL源碼編譯的變動
Mysql的安裝,對於mysql不同版本的mysql源碼編譯方式不一樣
5.6.2的版本開始編譯方式已經由 configure 變成了cmake方式 ,相關的新的
編譯方式在mysql官網已經提供
http://dev.mysql.com/doc/refman/5.6/en/source-configuration-options.html
源碼下載地址如下
http://dev.mysql.com/downloads/mysql/
網上相關mysql5.6的源碼編譯方式
http://www.chenyudong.com/archives/building-mysql-5-6-from-source.html
對於版本5.6之前的mysql,編譯方式還是傳統的編譯方式。
./configure
make && make install
此種編譯方式是傳統方式,具體配置參數 如 nginx 如下
下面是MYSQL5.6之前的編譯配置參數(來自網友資料)
--prefix=PREFIX:指定程序安裝路徑;
--enable-assembler:使用匯編模式;(文檔說明:compiling in x86 (and sparc) versions of common string operations, which should result in more performance. 匯編x86的普通操作符,可以提高性能)
--enable-local-infile:啟用對LOAD DATA LOCAL INFILE語法的支持(默認不支持);
--enable-profiling:Build a version with query profiling code (req.community-features)
--enable-thread-safe-client:使用編譯客戶端;(讓客戶端支持線程的意思)
--with-big-tables:啟用32位平台對4G大表的支持;
--with-charset=CHARSET:指定字符集;
--with-collation=:默認collation;
--with-extra-charsets=CHARSET,CHARSET,...:指定附加的字符集;
--with-fast-mutexes:Compile with fast mutexes
--with-readline:
--with-ssl:啟用SSL的支持;
--with-server-suffix=:添加字符串到版本信息;
--with-embedded-server:編譯embedded-server,構建嵌入式MySQL庫;
--with-pthread:強制使用pthread類庫;
--with-mysqld-user=:指定mysqld守護進程的用戶;
--with-mysqld-ldflags=:靜態編譯MySQL服務器端;(靜態鏈接提高13%性能)
--with-client-ldflags=:靜態編譯MySQL客戶端;(靜態鏈接提高13%性能)
--with-plugins=PLUGIN,PLUGIN 等等等(MySQL服務器端支持的存儲引擎組件(默認為空),可選值較多:
partition:MySQL Partitioning Support;
daemon_example:This is an example plugin daemon;
ftexample:Simple full-text parser plugin;
archive:Archive Storage Engine;
blackhole:Basic Write-only Read-never tables;
csv:Stores tables in text CSV format,強制安裝;
example:Example for Storage Engines for developers;
federated:Connects to tables on remote MySQL servers;
heap:Volatile memory based tables,強制安裝;
ibmdb2i:IBM DB2 for i Storage Engine;
innobase:Transactional Tables using InnoDB;
innodb_plugin:Transactional Tables using InnoDB;
myisam:Traditional non-transactional MySQL tables,強制安裝;
myisammrg:Merge multiple MySQL tables into one,強制安裝;
ndbcluster:High Availability Clustered tables;)
--with-plugin-PLUGIN:強制指定的插件鏈接至MySQL服務器;
--with-zlib-dir=:向MySQL提供一個自定義的壓縮類庫地址;
--without-server:僅安裝MySQL客戶端;
--without-query-cache:不要編譯查詢緩存;
--without-geometry:不要編譯geometry-related部分;
--without-debug:編譯為產品版,放棄debugging代碼;
--without-ndb-debug:禁用special ndb debug特性;基於以上,我的配置:./configure --prefix=/usr/local/mysql/
--with-server-suffix=yu
--enable-assembler
--enable-local-infile
--enable-thread-safe-client
--with-big-tables
--with-charset=utf8
--with-extra-charsets=gbk,gb2312,utf8,ascii
--with-readline
--with-ssl
--with-embedded-server
--with-pthread
--with-mysqld-user=mysql
--with-mysqld-ldflags=-all-static
--with-client-ldflags=-all-static
--with-plugins=partition,innobase,innodb_plugin