【发布时间】:2019-06-07 05:54:45
【问题描述】:
当尝试连接到在本地网络上运行的 MySQL 时,我收到了错误消息:
Host 'XXX' is not allowed to connect to this MySQL server.
免责声明(MySQL 版本 8)
下面提供的答案不能解决 MySQL v8
中的问题Host 'xxx.xx.xxx.xxx' is not allowed to connect to this MySQL server
host 'localhost' is not allowed to connect to this MySQL server (#1130)
这些旧答案中提供的解决方案在 MySQL Ver 8.0.13 中返回以下错误。
GRANT ALL PRIVILEGES ON mysql.* TO root@localhost IDENTIFIED BY 'pass123' WITH GRANT OPTION;
或者
Grant All Privileges ON *.* to 'root'@'%' Identified By 'pass123';
输出信息:
ERROR 1064 (42000):您的 SQL 语法有错误;检查 与您的 MySQL 服务器版本相对应的手册 在“IDENTIFIED BY 'pass123' WITH GRANT OPTION”附近使用的语法 1
【问题讨论】:
标签: mysql