2012-05-22 46 views
1
grant all privileges on 'bbs' to 'userone'@'localhost' IDENTIFIED BY PASSWORD 'user2012'; 

它顯示ERROR 1064 (42000): You have an error in your SQL syntax; check the manualgrant all命令有什麼問題?

我想添加一個用戶userone並授予所有權限到數據庫bbs。 如何糾正它?

+0

什麼是錯誤的休息嗎? – Corbin

回答

6

您需要在要授予權限的數據庫中包含表的指示符。更改查詢:

grant all privileges on bbs.* to 'userone'@'localhost' IDENTIFIED BY PASSWORD 'user2012';

授予它在「論壇」數據庫中的所有表。

0
grant all privileges on 'bbs.*' to 'userone'@'localhost' identified by ‘user2012’; 
2

離開'在表名:

grant all privileges on bbs to 'userone'@'localhost' IDENTIFIED BY PASSWORD 'user2012';