环境:aws-ec2
1、下载
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
2、查看服务器已安装的版本并卸载
yum repolist enabled | grep "mysql.*-community.*"
执行后发现安装了8.0
rpm -qa | grep -i mysql 查看安装了哪些8.0的依赖
yum remove mysql-community-libs-compat-8.0.12-1.el7.x86_64
.....
yum install mysql57-community-release-el7-10.noarch.rpm
3、安装
yum install mysql-community-server
4、启动并修改密码
service mysqld start
netstat -ntl 查看默认端口3306是否成功启动
cat /var/log/mysqld.log |grep password 查看默认root密码
mysql -u root -p
alter user user() identified by "fdsafdasfdas@1311231sfsa";