0

我正在使用 MySQL 8.0 设置开发服务器,并尝试从我的笔记本电脑以 root 身份远程连接 Workbench。这让我访问被拒绝错误,因此,尝试应用其他地方提供的解决方案,即授予所有特权......,我仍然没有到达那里。自从发布这些解决方案后,可能发生了一些变化(例如 [ Enable remote MySQL connection: ERROR 1045 (28000): Access denied for user)。

从服务器:

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql -uroot -ppassword
mysql> grant all privileges on *.* to 'root'@'%' identified by 'password';

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use
near 'identified by 'password'' at line 1

如果我删除消息抱怨的部分:

mysql> grant all privileges on *.* to 'root'@'%';

ERROR 1410 (42000): You are not allowed to create a user with GRANT

有什么建议吗?

谢谢!

R。

4

1 回答 1

0

在第一个命令中,您的密码拼写错误应该是

mysql -uroot -password

我认为您在服务器上设置的 MySQL 不正确,重新安装并输入

mysql_secure_installation

它会要求输入密码和用户名,创建一个并使用它。
希望这可以帮助

于 2018-07-13T15:20:14.573 回答