Grant lock tables on single table gives ERROR 1144

Grant lock tables on single table gives ERROR 1144

am 26.04.2007 12:51:01 von serman_d

Hi,

Tested on MySQL 4.1.20 and 5.0.33 with similar results. I don't
understand why I cannot grant LOCK TABLES on a single table, while
granting LOCK TABLES on all tables work fine.

mysql> SELECT VERSION()\G
*************************** 1. row ***************************
VERSION(): 4.1.20
1 row in set (0.00 sec)

mysql> SELECT CURRENT_USER()\G
*************************** 1. row ***************************
CURRENT_USER(): root@localhost
1 row in set (0.02 sec)

mysql> CREATE DATABASE grant_test;
Query OK, 1 row affected (0.04 sec)

mysql> USE grant_test;
Database changed
mysql> CREATE TABLE t (i INTEGER PRIMARY KEY NOT NULL);
Query OK, 0 rows affected (0.02 sec)

mysql> GRANT SELECT ON grant_test.t TO grant_test_user IDENTIFIED BY
'foobar';
Query OK, 0 rows affected (0.12 sec)

mysql> GRANT LOCK TABLES ON grant_test.t TO grant_test_user IDENTIFIED
BY 'foobar';
ERROR 1144 (42000): Illegal GRANT/REVOKE command; please consult the
manual to see which privileges can be used
mysql> GRANT LOCK TABLES ON grant_test.* TO grant_test_user IDENTIFIED
BY 'foobar';
Query OK, 0 rows affected (0.03 sec)

--
Serman D.

Re: Grant lock tables on single table gives ERROR 1144

am 27.04.2007 06:22:43 von gordonb.6tzjd

>Tested on MySQL 4.1.20 and 5.0.33 with similar results. I don't
>understand why I cannot grant LOCK TABLES on a single table, while
>granting LOCK TABLES on all tables work fine.

Privileges exist at one or more of 4 levels: global, database,
table, and column. LOCK TABLES exists only at the global and database
levels.

Re: Grant lock tables on single table gives ERROR 1144

am 27.04.2007 08:27:46 von serman_d

On Apr 27, 6:22 am, gordonb.6t...@burditt.org (Gordon Burditt) wrote:
> >Tested on MySQL 4.1.20 and 5.0.33 with similar results. I don't
> >understand why I cannot grant LOCK TABLES on a single table, while
> >granting LOCK TABLES on all tables work fine.
>
> Privileges exist at one or more of 4 levels: global, database,
> table, and column. LOCK TABLES exists only at the global and database
> levels.

Gordon, Thanks for the clarification.

--
Serman D.