Why is GRANT not working in MySQL? Why is GRANT not working in MySQL? mysql mysql

Why is GRANT not working in MySQL?


What you are selecting are the global privileges.You are however giving database (and host, but that doesn't matter) specific privileges.

GRANT INSERT ON wordpress.* TO 'www'@'localhost' IDENTIFIED BY 'basic';

These permissions are stored in the db table.

Just to point you in the right direction:

SHOW GRANTS FOR 'www'@'localhost'

http://dev.mysql.com/doc/refman/5.0/en/show-grants.html


That's not where the most user GRANTed rights are stored - try

SHOW GRANTS FOR 'www'@'localhost'

to see database-specific permissions instead. (A grant would only show up in the user table if it was for all databases.)

Here's a (rather old) step-by-step detail of how permissions are stored in MySQL - I don't think things have changed much.


This should work:

GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';