版权声明:版权所有,转载请注明出处.谢谢 https://blog.csdn.net/weixin_35353187/article/details/81712096
1.下载一个rpm
下载地址 : https://dev.mysql.com/downloads/repo/yum/
选择对应的CentOS版本
2 . 将rpm文件上传到Linux里面
3 . 安装上一个配置文件(包含了mysql的yum下载配置文件)
rpm -ivh mysql80-community-release-el6-1.noarch.rpm
修改配置文件 vi /etc/yum.repos.d/mysql-community.repo
把5.7的 enabled=0 改为 enabled=1
把8.0的 enabled=1 改为 enabled=0
4 . 安装 yum install -y mysql-community-server
5 . 启动服务
service mysqld start
service mysqld restart
6.查出临时密码
grep 'temporary password' /var/log/mysqld.log
7.登陆:
mysql -uroot -p
8.修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';