linux 64位centos下源码安装mysql服务教程

1.下载mysql源码包

打开地址https://dev.mysql.com/downloads/mysql/,选择下载MySQL Community Server源码包

分别选择Source Code和Generic Linux (Architecture Independent)选项,最后选择Compressed TAR Archive得到下载地址https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21.tar.gz

linux 64位centos下源码安装mysql服务教程

2.下载boost_1_66_0源码

(https://dev.mysql.com/doc/refman/5.7/en/installing-source-distribution.html)

shell>mkdir /www/boost/

shell>wget "https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz"

shell>tar zxvf boost_1_66_0.tar.gz

3.linux下源码安装

shell> groupadd mysql
shell> useradd -r -g mysql -s /bin/false mysql
shell> useradd -r -g mysql -s /bin/false mysql
shell> tar zxvf mysql-5.7.21.tar.gz
shell> cd  mysql-5.7.21
shell> mkdir bld
shell> cd bld shell> cmake  --WITH_BOOST /www/soft/boost/boost_1_66_0 ..

shell> make

linux 64位centos下源码安装mysql服务教程

编译很慢,取决于服务器的性能,4个cpu,编译1个小时左右
shell> make install

linux 64位centos下源码安装mysql服务教程

shell> cd /usr/local/mysql
shell> mkdir mysql-files
shell> chown mysql:mysql mysql-files
shell> chmod 750 mysql-files
shell> bin/mysqld--no-defaults--initialize --user=mysql --basedir=/usr/local/mysql --datadir=/www/mysql/data
shell> bin/mysql_ssl_rsa_setup              
shell> bin/mysqld_safe --defaults-file=my.cnf &

4.参考资料

https://dev.mysql.com/doc/refman/5.7/en/installing-source-distribution.html

yum安装mysql版本:https://blog.csdn.net/qq_34203492/article/details/71126686

通俗易懂:linux下安装mysql:http://www.zuidaima.com/blog/3719668977945600.htm

centos7 64位 无外网安装mysql:http://www.zuidaima.com/blog/3598480115796992.htm

在Linux系统上集成项目所需环境(mysql+jdk+tomcat):http://www.zuidaima.com/blog/3822329080056832.htm

猜你喜欢

转载自my.oschina.net/u/3803405/blog/1799301
今日推荐