CentOS 7 源码安装 MySQL5.7
1、解决依赖包并下载源码包至/root/install/目录
1 # yum -y install gcc gcc-c++ ncurses ncurses-devel cmake bison 2 # cd /root/install/ 3 # wget https://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz 4 # tar -zxvf boost_1_59_0.tar.gz #解压 5 # mv boost_1_59_0 /usr/local/boost #移动至/usr/local/boost/目录下 6 # wget http://cdn.mysql.com/Downloads/MySQL-5.7/mysql-5.7.17.tar.gz 7 # tar -zxvf mysql-5.7.17.tar.gz
2、新建MySQL用户和用户组,创建/data/mysql 目录存放mysql数据
3、预编译及编译安装
4、设置启动脚本,开机自启动
5、拷贝my.cnf至/etc/目录下,并初始化数据库
6、启动服务
7、root管理员修改密码