Mukesh Kumar
Mukesh Kumar

Reputation: 11

GRANT ALL PRIVILEGES is not working for me

GRANT ALL PRIVILEGES ON database.* TO 'username'@'localhost' IDENTIFIED BY 'password';

I got the ERROR

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 ''username'@'localhost' IDENTIFIED BY 'password' at line 1

Upvotes: 0

Views: 819

Answers (1)

Rahul
Rahul

Reputation: 18577

You can create user first and then grant

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON database.* TO 'username'@'localhost';

Should work.

Source.

Upvotes: 1

Related Questions