1.到服务器下载的链接
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
2.执行命令
sudo rpm -ivh mysql57-community-release-el7-11.noarch.rpm
3.安装mysql
yum -y install mysql mysql-server
4.启动
service mysqld start
5.Mysql 5.7 初始化密码
grep 'temporary password' /var/log/mysqld.log
6.修改 root 密码
登录
mysql -u root -p
修改密码
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('密码');
刷新,立刻生效
FLUSH PRIVILEGES;