最代码官方的gravatar头像
最代码官方 2018-04-05 13:24:18
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

2.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 &

3.参考资料

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


打赏
最近浏览
全栈小白  LV34 2023年1月8日
最远的旅行  LV3 2019年10月22日
80730176  LV7 2019年6月14日
韩毅飞  LV11 2019年4月13日
PaymentCodeSystem  LV11 2019年1月8日
di1221  LV7 2018年11月27日
2252536772  LV21 2018年10月23日
MINGZHUCODE  LV8 2018年10月9日
塔塔二  LV2 2018年9月5日
蓝色魅影  LV4 2018年8月20日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友