mysql-5.7密码

1.默认随机密码会过期,提示如下

mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

解决办法:

2.SET PASSWORD = PASSWORD(‘your new password‘);

3. ALTER USER ‘root’@’localhost’ PASSWORD EXPIRE NEVER;

4.flush privileges;

 

收工!

评论关闭。