您的位置:首页 > 数据库 > MySQL

mac mysql error You must reset your password using ALTER USER statement before executing this statem

2016-05-19 11:37 627 查看
安装完 mysql 之后,登陆以后,不管运行任何命令,总是提示这个

Step 1:

SET PASSWORD = PASSWORD('your new password');


Step 2:

ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;


Step 3:

flush privileges;


完成以上三步退出再登,使用新设置的密码就行了

参考1: https://dev.mysql.com/doc/refman/5.6/en/alter-user.html

参考2: http://dev.mysql.com/doc/refman/5.7/en/password-expiration-policy.html

参考3: http://stackoverflow.com/questions/33467337/reset-mysql-root-password-using-alter-user-statement-after-install-on-mac
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: