1.卸载系统自带mysq(没有忽略此步骤)
[[email protected] ~]$ rpm -qa|grep mysql
mysql-community-common-5.7.19-1.el6.x86_64
rpm -e --nodeps mysql-community-common-5.7.19-1.el6.x86_64
2.下载解压安装包
[[email protected] apps]$ wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz
[[email protected] apps]$ tar -zxvf mysql-5.7.23-linux-glibc2.12-x86_64
3.修改配置文件
[[email protected] apps]$ cd mysql-5.7.23-linux-glibc2.12-x86_64/support-files/
[[email protected] support-files]$ vi mysql.server
4.安装
[[email protected] support-files]$ sudo cp mysql.server /etc/init.d/mysqld
[[email protected] support-files]$ cd ../bin/
[[email protected] bin]$ ./mysqld --user=mysql --basedir=/home/admin/apps/mysql-5.7.23-linux-glibc2.12-x86_64 --datadir=/home/admin/data/mysql/data --initialize
此步骤有可能报错:/bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file:
解决方案:sudo yum remove libnuma.so.1
sudo yum -y install numactl.x86_64
yum install -y libaio
5.启动mysql服务
[[email protected] bin]$ service mysqld start
6.登录修改root密码
7.卸载
原文地址:https://www.cnblogs.com/pig-driving-spacecraft/p/9501274.html