centos7 安装 mysql5.7

1
2
3
4
5
6
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
yum localinstall mysql57-community-release-el7-11.noarch.rpm
yum repolist enabled | grep "mysql.*-community.*"
yum install -y mysql-community-server
systemctl enable mysqld
systemctl start mysqld
1
2
3
4
5
6
7
8
9
10
11
grep 'temporary password' /var/log/mysqld.log
mysql -uroot -p

ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass1!';

set password for 'root'@'localhost'=password('MyNewPass1!');


mysql> use mysql;
mysql> update user set password=PASSWORD('MyNewPass2!') where user='root';
mysql> flush privileges;

参考链接:

https://www.jianshu.com/p/1dab9a4d0d5f