0
votes
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

1
Which MySQL version are you using?jarlh

1 Answers

1
votes

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.