Grant lock tables on single table gives ERROR 1144

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 [at] 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.
serman_d [ Do, 26 April 2007 12:51 ] [ ID #1698105 ]

Re: Grant lock tables on single table gives ERROR 1144

>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.
gordonb.6tzjd [ Fr, 27 April 2007 06:22 ] [ ID #1699121 ]

Re: Grant lock tables on single table gives ERROR 1144

On Apr 27, 6:22 am, gordonb.6t... [at] 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.
serman_d [ Fr, 27 April 2007 08:27 ] [ ID #1699124 ]
Datenbanken » mailing.database.mysql » Grant lock tables on single table gives ERROR 1144

Vorheriges Thema: Regenerate a Nested Set using parent_id structure
Nächstes Thema: Login page perl/CGI