首先我正在关注这个教程。
正如他们提到的,我正在写我的查询:
mysql> grant select
-> on play.*
-> to 'guest' @ 'localhost'
-> IDENTIFIED BY '459459';
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 ''localhost'
IDENTIFIED BY '459459'' at line 3
mysql>
但我仍然收到错误。我做错了什么?
答案1
从您提供的链接来看,答案似乎是关键词 TO 的大写,或者是@
在第 3 行的两侧都放置了一个空格。
展示:
-> to 'guest' @ 'localhost'
正确的语法
-> TO 'guest'@'localhost'