重置MySQL root密码Mac Error 1131

时间:2016-11-11 17:30:02

标签: mysql passwords root

我试图在Mac OS Sierra上安装的mysql中重置root密码。我一直收到此错误:ERROR 1131 (42000): You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords

这是我输入的命令:

sudo mysqld_safe --skip-grant-tables
mysql -u root
FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPassword';

有什么想法吗?

0 个答案:

没有答案