run
run

Reputation: 553

what's wrong with the grant all command?

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

Answers (3)

juergen d
juergen d

Reputation: 204766

Leave the ' at the table name:

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

Upvotes: 2

Addicted
Addicted

Reputation: 1704

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

Upvotes: 0

Jeshurun
Jeshurun

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

Related Questions