Lniux下安装mysql----编译版
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Lniux下安装mysql----编译版相关的知识,希望对你有一定的参考价值。
####安装mysql-5.7.10
rpm -e --nodeps mysql
rpm -e mysqlclient10
useradd -g mysql -s /sbin/nologin
install_mysql_server()
{
cd /download/;unzip boost_1_59_0.zip
mkdir -p /usr/local/mysql/
mkdir -p /data/mysqldata
mkdir -p /usr/local/mysql/etc
tar -zxf mysql-5.7.10.tar.gz
cd mysql-5.7.10
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/data/mysqldata \
-DWITH_BOOST=../boost_1_59_0 \
-DSYSCONFDIR=/usr/local/mysql/etc \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DENABLE_DTRACE=0 \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DWITH_EMBEDDED_SERVER=1
make && make install
if [ $? -ne 0 ]; then
echo -e "Warnning \033[0;31;1m Mysql Make error \033[0m failed."
exit 10
fi
exit;
cd ../
/bin/cp /downloads/my.cnf /usr/local/mysql/etc/
ln -s /usr/local/mysql/etc/my.cnf /etc/
chown -R mysql:mysql /usr/local/mysql
chown -R mysql:mysql /data/mysqldata
chown -R mysql:mysql /var/lib/mysql
}
install_mysql_server;
以上是关于Lniux下安装mysql----编译版的主要内容,如果未能解决你的问题,请参考以下文章