MySQL服务器远程访问被拒绝

时间:2018-07-13 13:31:21

标签: mysql remote-access

我正在使用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。

1 个答案:

答案 0 :(得分:0)

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

mysql -uroot -password

我认为您在服务器上错误地设置了MySQL,然后重新安装并输入

mysql_secure_installation

它将要求输入密码和用户名,创建并使用它。
希望这会有所帮助

相关问题