【mac】You must reset your password using ALTER USER statement before executing this statement.

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/lyl614976970/article/details/81909527

在mac上使用mysql,使用过程中突然报错 You must reset your password using ALTER USER statement before executing this statement. 从错误提示上不难看出需要修改密码。

1、登录mysql:/usr/local/mysql/bin/mysql -u root -p '123456'

2、修改密码:SET PASSWORD = PASSWORD('000000');

3、为了避免之后再次出现密码过期:ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;

4、刷新权限:flush privileges;

猜你喜欢

转载自blog.csdn.net/lyl614976970/article/details/81909527
今日推荐