neubert
neubert

Reputation: 16802

unable to grant LOCK TABLES permission to user

I'm running MySQL 5.1.73-0ubuntu0.10.04.1-log and I'm trying to make it so a user can LOCK TABLES. I GRANTed LOCK TABLEs with the following:

That responds with Query OK, 0 rows affected (0.00 sec).

After that, when I login as dbuser, and try to do LOCK TABLES table_name WRITE; I get the following error:

ERROR 1044 (42000): Access denied for user 'dbuser'@'localhost' to database 'dbname'

I do SHOW GRANTS as dbuser and do not see any GRANT for LOCK TABLES.

Any ideas?

Upvotes: 2

Views: 17381

Answers (2)

We Are All Monica
We Are All Monica

Reputation: 13344

It's been a while since this question was asked, but for anyone having the same issue, try running FLUSH PRIVILEGES; in MySQL.

Upvotes: 0

leonardo
leonardo

Reputation: 1

It´s been long time since you post this question. Anyway in my opinion you should be more specific on what database to lock. Perhaps is not quite good to lock all of them (.) because mysql itself uses a database for system puporses so once you adquire a lock to a table you have only access to that table as documentation says. Perhaps the information about locking is stored on that system database named mysql. So you're locking the one wich store the lock itself.

Upvotes: 0

Related Questions