简体   繁体   中英

Can't grant column specific privileges in MySQL

Going off of this answer I am executing the below statements

CREATE TABLE person
(
   id      INT NOT NULL AUTO_INCREMENT,
   PRIMARY KEY (id)
);
GRANT SELECT ON person(id) TO SomeOne;

but when I do so, I get the following error:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(id) TO SomeOne' at line 1

Can someone shed some light as to why I am getting this error.

MysQL version:

mysql Ver 14.14 Distrib 5.1.58, for debian-linux-gnu (i686) using readline 6.2

尝试:


GRANT select (`id`) ON your_db_name.your_table_name TO SomeOne

GRANT SELECT (id) ON person TO SomeOne;

此处查看文档以了解更多详细信息。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM