A.Sh A.Sh - 1 year ago 159
MySQL Question

Mysql workbench Error 1044 / 1142: Access / Grant command denied to user ''@'localhost' for

I work on a Mac OSX 10.6.8, and I use Mysql Workbench to learn how to handle databases (I'm a beginner as far as databases go). Now, I have created a few users, and I'm trying to toy around with giving these users' rights, and let them interact with each other by granting and revoking each other various rights.

I have logged in via the root user and supposedly given all "toy users" their initial rights by using the necessary grant queries (verified via queries using "show grants"), but then I try to log in as the various users. Let's say two of these users are named "Sofia" and "Martin", and I want Sofia to give Martin the update- and insert-rights to a table "Book". Sofia was given the necessary privileges from my root-login unless I am mistaken, so I write (when logged in as Sofia)

grant update, insert on Book to Martin;

This yields the error

Error 1142: GRANT command denied to user ''@'localhost' for table 'book'

Further, I try to figure out what rights Sofia does have, and enter the following query

show grants for Sofia;

when logged in as Sofia. The response:

Error 1044: Access denied to user ''@'localhost' for database 'mysql'

What is this mysterious ''@'localhost' user the errors are talking about? What should I do to make things work?

Answer Source
grant update, insert on Book.* to `Martin`@`%`;

please click edit to see the back-ticks

See the MySQL manual page on SHOW GRANTS

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download