要格兰特我有错误1064(42000)

时间:2014-03-05 22:14:53

标签: mysql sql database

我在mysql中制作一个简单的Grant,但想知道下面代码有什么问题。

   GRANT ALL PRIVILEGES 
    ON name_database.* 
    TO 'root'@'localhost'  
   IDENTIFIED BY PASSWORD '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

1 个答案:

答案 0 :(得分:1)

尝试:

  GRANT ALL PRIVILEGES 
    ON name_database.* 
    TO 'root'@'localhost'  
   IDENTIFIED BY 'password'; /*<--- no PASSWORD KEYWORD*/