Reputation: 553
grant all privileges on 'bbs' to 'userone'@'localhost' IDENTIFIED BY PASSWORD 'user2012';
It shows ERROR 1064 (42000): You have an error in your SQL syntax; check the manual
I want to add a user userone
and grant all privileges to the database bbs
.
How to correct it?
Upvotes: 2
Views: 12828
Reputation: 204766
Leave the '
at the table name:
grant all privileges on bbs to 'userone'@'localhost' IDENTIFIED BY PASSWORD 'user2012';
Upvotes: 2
Reputation: 1704
grant all privileges on 'bbs.*' to 'userone'@'localhost' identified by ‘user2012’;
Upvotes: 0
Reputation: 23186
You need to include an indicator for the tables in the database you want to grant the privilege. Change the query:
grant all privileges on bbs.* to 'userone'@'localhost' IDENTIFIED BY PASSWORD 'user2012';
to grant it for all the tables in the 'bbs' database.
Upvotes: 8