GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON databasename.* TO username'@'localhost' IDENTIFIED BY 'password';
...
If successful, MySQL will reply with:
Query OK, 0 rows affected
To activate the new permissions, enter the following command:
FLUSH PRIVILEGES;
But using the GRANT command doesn't require to flush privileges. The changes would be applied instantly. We only need the flush privileges if we manually modified the mysql database using UPDATE or INSERT.
Comments
Comment #1
blakehall commentedMakes sense according to the MySQL 5.1, MySQL 5.0, and MySQL 4.1 Documentation.
Patch attached...
(Will backport if desired)
Comment #2
webchickLooks good to me.
Comment #3
gábor hojtsySimple, and logical. Committed.
Comment #4
(not verified) commented