这篇文章主要讲解了“centos7源码安装mysql5.7的过程”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“centos7源码安装mysql5.7的过程”吧!
下载:
https://dev.mysql.com/downloads/mysql/
或
https://github.com/dollarphper/soft/blob/master/mysql/mysql-boost-5.7.24.tar.gz
安装依赖:
yum -y install cmake gcc gcc-c++ ncurses ncurses-devel libaio-devel openssl openssl-devel
创建用户:
useradd mysql -s /sbin/nologin -M
创建文件夹:
mkdir -p /usr/local/mysql/data
解压:
tar -xzf mysql-boost-5.7.24.tar.gz
编译安装:
cd mysql-5.7.24
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/etc \
-DMYSQL_TCP_PORT=3306 \
-DWITH_BOOST=./boost
make && make install
修改所属主为mysql:
chown -R mysql.mysql /usr/local/mysql
修改配置文件:
vim /etc/my.cnf
[mysqld]
server-id=1
port=3306
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
ngram_token_size=2
初始化:
/usr/local/mysql/bin/mysqld --initialize-insecure --user=mysql --datadir=/usr/local/mysql/data
启动服务:
/usr/local/mysql/bin/mysqld_safe --user=mysql &
感谢各位的阅读,以上就是“centos7源码安装mysql5.7的过程”的内容了,经过本文的学习后,相信大家对centos7源码安装mysql5.7的过程这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是天达云,小编将为大家推送更多相关知识点的文章,欢迎关注!