0
mysql> GRANT, SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX,
-> ALTER, CREATE TEMPORARY TABLES, LOCK TABLES
-> ON dbname.*
-> TO 'user'@'localhost'
-> IDENTIFIED BY 'pass';

ERROR 1064 (42000):您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的 'SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TA' 附近使用正确的语法

最近经常出现这个错误,不知道为什么。

4

2 回答 2

-1

后面没有逗号GRANT

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX,
-> ALTER, CREATE TEMPORARY TABLES, LOCK TABLES
-> ON dbname.*
-> TO 'user'@'localhost'
-> IDENTIFIED BY 'pass';
于 2013-10-27T05:38:14.463 回答
-1

comma ,通过删除后面的来试试这个GRANT: -

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX,
-> ALTER, CREATE TEMPORARY TABLES, LOCK TABLES
-> ON dbname.*
-> TO 'user'@'localhost'
-> IDENTIFIED BY 'pass';
于 2013-10-27T05:38:39.603 回答