我试图在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';
有什么想法吗?