首页 > 数据库技术 > 详细

Mac 安装 MySQL 5.7 后登入后无法执行命令【You must reset your password using ALTER USER statement before executing this statement.】

时间:2018-06-01 14:19:34      阅读:240      评论:0      收藏:0      [点我收藏+]

今天在 Mac 上安装了 MySQL 5.7 ,启动服务后,输入 mysql -u root -p 后,输入初始密码程,尝试执行 show databases; 

报了一个 You must reset your password using ALTER USER statement before executing this statement. 错误。

参考 Stack Overflow 上一篇文章 https://stackoverflow.com/questions/33467337/reset-mysql-root-password-using-alter-user-statement-after-install-on-mac

步骤如下:

set password = password(‘your new password‘);

alter user ‘root‘@‘localhost‘ password expire never;

flush privileges;

技术分享图片

 

Mac 安装 MySQL 5.7 后登入后无法执行命令【You must reset your password using ALTER USER statement before executing this statement.】

原文:https://www.cnblogs.com/zacky31/p/9121302.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!