[root@god ~]# grep password /var/log/mysqld.log
2020-09-11T10:58:46.152697Z 1 [Note] A temporary password is generated for root@localhost: p(-Jp)6d!4RW
[root@xuegod69 ~]# mysql -uroot -p
Enter password:
mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password_length=6;
Query OK, 0 rows affected (0.00 sec)
mysql> SET PASSWORD FOR root@localhost=PASSWORD(‘123456‘);
Query OK, 0 rows affected, 1 warning (0.00 sec)
原文:https://www.cnblogs.com/jasonwu/p/13653516.html