tar xf mariadb-10.0.12.tar.gz cd mariadb-10.0.12 cat INSTALL-SOURCE
Instructions for building MariaDB can be found at: https://kb.askmonty.org/en/compiling-mariadb-from-source/ https://mariadb.com/kb/en/mariadb/source-building-mariadb-on-centos/ |
cmake . -LH #获取帮助信息 #建立mysql用户 useradd -r mysql #建立数据目录 mkdir /mydata/data -pv #更改数据目录的权限 chown -R mysql.mysql /mydata/data/ #相当于./configure # cmake . -DMYSQL_DATADIR=/mydata/data \ -DWITH_SSL=system \ -DWITH_SPHINX_STORAGE_ENGINE=1 \ make make install #复制启动脚本 cd /usr/local/mysql/ cp support-files/mysql.server /etc/rc.d/init.d/mysqld chmod +x /etc/rc.d/init.d/mysqld #复制配置文件 cp support-files/my-large.cnf /etc/my.cnf vi /etc/my.cnf datadir = /mydata/data scripts/mysql_install_db --user=mysql --datadir=/mydata/data service mysqld start
一些选项:
半同步:
// Link SEMISYNC_MASTER statically to the server
WITH_SEMISYNC_MASTER:BOOL=OFF
// Link SEMISYNC_SLAVE statically to the server
WITH_SEMISYNC_SLAVE:BOOL=OFF
是否显示响应时间,开启可能会导致性能略降:
// Link QUERY_RESPONSE_TIME statically to the server
WITH_QUERY_RESPONSE_TIME:BOOL=OFF
// Link QUERY_CACHE_INFO statically to the server
WITH_QUERY_CACHE_INFO:BOOL=OFF
分区表,横向扩展用到:
// Link PARTITION statically to the server
WITH_PARTITION_STORAGE_ENGINE:BOOL=ON
是否接受tcp wrappers的控制:
// Compile with tcp wrappers support
WITH_LIBWRAP:BOOL=OFF
是否使用本地化:
// Link LOCALES statically to the server
WITH_LOCALES:BOOL=OFF
嵌入式环境用到:
// Compile MySQL with embedded server
WITH_EMBEDDED_SERVER:BOOL=OFF
是否支持CONNECT_STORAGE_ENGINE
// Link CONNECT statically to the server
WITH_CONNECT_STORAGE_ENGINE:BOOL=OFF
是否支持BLACKHOLE_STORAGE_ENGINE
// Link BLACKHOLE statically to the server
WITH_BLACKHOLE_STORAGE_ENGINE:BOOL=OFF