yum安装指定版本的mysql
https://www.51anidea.com/forum.php?mod=viewthread&tid=513
(出处: Linux教程网)
一、环境
CentOS 7.4
二、安装方法
1、下载mysql源
#wget http://repo.mysql.com/mysql80-community-release-el7.rpm
(如果要安装其他版本的mysql,可以去 http://repo.mysql.com/ 下面查找其他版本的mysql)
2、安装mysql源
#rpm -ivh mysql80-community-release-el7.rpm
3、安装mysql
#yum -y install mysql-server
4、更改权限
#chown mysql:mysql -R /var/lib/mysql
5、初始化
#mysqld --initialize
6、启动mysql
#systemctl start mysqld
(1)如果无法启动(也许是与之前的mysql版本不兼容)
查看日志
#cat /var/log/mysqld.log
2019-09-14T06:28:57.838520Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2019-09-14t06:28:57.838520Z 0[错误][my-010457][服务器]--已指定初始化,但date目录中有文件。中止。
原来是date目录中有文件。