[root@localhost ~]# wget -i -c http;//dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
[root@localhost ~]# yum install mysql57-community-release-el7-10.noarch.rpm -y
[root@localhost ~]# yum install mysql-community-server -y
[root@localhost ~]# systemctl start mysqld
[root@localhost ~]# grep "password" /var/log/mysqld.log
2020-10-14T09:08:20.216673Z 1 [Note] A temporary password is generated for root@localhost: dpdHfbGX-4-O
4.登录mysql
[root@localhost ~]# mysql -uroot -p
Enter password:
mysql> alter user ‘root‘@‘localhost‘ identified by ‘lile@5201314‘;
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password_length=5;
Query OK, 0 rows affected (0.00 sec)
mysql> set password = password(‘000000‘);
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> alter user ‘root‘@‘localhost‘ identified by ‘lile@5201314‘;
原文:https://www.cnblogs.com/insi2020/p/13816133.html