【MariaDB】MariaDB編譯參數

參考:php

http://wangfeng7399.blog.51cto.com/3518031/1393146?utm_source=tuicoolhtml

http://www.phperz.com/article/14/1202/38819.htmlmysql

官網說明:linux

編譯https://mariadb.com/kb/zh-cn/generic-build-instructions/c++

環境https://mariadb.com/kb/zh-cn/linuxmariadb/sql

yum -y install cmake make glibc gcc gcc-c++ libstdc++* sysstat lrzsz libtool libxml* libtool-ltdl-devel* libaio autoconf automake zlib* ncurses* ncurses-devel bison bison-devel app

使用cmake編譯MariaDB-5.5
cmake指定編譯選項的方式不一樣於make,其實現方式對好比下:
./configure cmake .
cmake . -LH or ccmake .
指定安裝文件的安裝路徑時經常使用的選項:
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql
-DMYSQL_DATADIR=/data/mysql
-DSYSCONFDIR=/etc
默認編譯的存儲引擎包括:csv、myisam、myisammrg和heap。若要安裝其它存儲引擎,能夠使用相似以下編譯選項:
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DWITH_ARCHIVE_STORAGE_ENGINE=1
-DWITH_BLACKHOLE_STORAGE_ENGINE=1
-DWITH_FEDERATED_STORAGE_ENGINE=1
若要明確指定不編譯某存儲引擎,能夠使用相似以下的選項:
-DWITHOUT_<ENGINE>_STORAGE_ENGINE=1
好比:
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1
-DWITHOUT_FEDERATED_STORAGE_ENGINE=1
-DWITHOUT_PARTITION_STORAGE_ENGINE=1
如若要編譯進其它功能,如SSL等,則可以使用相似以下選項來實現編譯時使用某庫或不使用某庫:
-DWITH_READLINE=1
-DWITH_SSL=system
-DWITH_ZLIB=system
-DWITH_LIBWRAP=0
其它經常使用的選項:
-DMYSQL_TCP_PORT=3306
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock
-DENABLED_LOCAL_INFILE=1
-DEXTRA_CHARSETS=all
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci
-DWITH_DEBUG=0
-DENABLE_PROFILING=1
若是想清理此前的編譯所生成的文件,則須要使用以下命令:
make clean
rm CMakeCache.txtui

cmake -DCMAKE_INSTALL_PREFIX=/servers/mariadb -DSYSCONFDIR=/servers/mariadb/etc -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_SPHINX_STORAGE_ENGINE=1 -DWITH_XTRADB_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DWITH_PARTITION_STORAGE_ENGINE=1
make && make install spa

編譯完初始化要加載配置,不然會報錯:server

Unable to load replication GTID slave state from mysql.gtid_slave_pos: Table 'mysql.gtid_slave_pos' doesn't exist in engine http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html

用mysql_upgrade也會報:

Phase 1/5: Checking mysql database
Processing databases
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.gtid_slave_pos
Error : Table 'mysql.gtid_slave_pos' doesn't exist in engine
status : Operation failed
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats
Error : Table 'mysql.innodb_index_stats' doesn't exist in engine
status : Operation failed
mysql.innodb_table_stats
Error : Table 'mysql.innodb_table_stats' doesn't exist in engine
status : Operation failed
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
mysql.servers OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK

Repairing tables
mysql.gtid_slave_pos
Error : Table 'mysql.gtid_slave_pos' doesn't exist in engine
status : Operation failed
mysql.innodb_index_stats
Error : Table 'mysql.innodb_index_stats' doesn't exist in engine
status : Operation failed
mysql.innodb_table_stats
Error : Table 'mysql.innodb_table_stats' doesn't exist in engine
status : Operation failed
Phase 2/5: Running 'mysql_fix_privilege_tables'...
ERROR 1932 (42S02) at line 580: Table 'mysql.innodb_index_stats' doesn't exist in engine
ERROR 1932 (42S02) at line 583: Table 'mysql.innodb_table_stats' doesn't exist in engine
FATAL ERROR: Upgrade failed

初始化:

[root@T18555 data]# /servers/mariadb/scripts/mysql_install_db --defaults-file=/servers/mariadb/etc/my.cnf --basedir=/servers/mariadb/ --datadir=/data/mariadb/data/

相關文章
相關標籤/搜索