---恢复内容开始---
1.去官网下载合适的yum源安装包
https://dev.mysql.com/downloads/repo/yum/
2.yum 本地安装
命令:yum localinstall mysql57-community-release-el7-11.noarch.rpm
3.检查mysql源是否安装成功
命令:yum repolist enabled | grep "mysql.*-community.*"
4.安装mysql
命令:yum install mysql-community-server
5.启动MySQL服务
命令:systemctl start mysqld
6.查看mysql的启动状态
命令:systemctl status mysqld
7.开机启动
命令:
systemctl enable mysqld
systemctl daemon-reload
8.修改root本地登录密码:
a.在/var/log/mysqld.log找到生成的默认密码:grep ‘temporary password‘ /var/log/mysqld.log
b.登录:mysql -uroot -p;
---恢复内容结束---