I\'m scratching my head on this one as I see a ton of helper websites showing how to create MySQL users and grant privileges but for some reason it just does not work for me
This should work:
GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
what you are selecting are the global privileges. you are however giving database (and host, but that doesnt matter) specific privileges.
GRANT INSERT
ON wordpress
.* TO 'www'@'localhost' IDENTIFIED BY 'basic';
theese 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
You need to look at mysql.db or mysql.tables_priv tables if you need to select the Y or N if you are trying to do some restrictions of from what page a user can edit or insert or delete... This tables are automatically updated with the Ys and Ns as they are solely designed to show what privileges a user has on tables or columns as opposed to mysql.user whose purpose is to show that there is a certain user who can login(create connection) to a database.
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.