无法在 MySQL 中授予列特定权限 [英] Can't grant column specific privileges in MySQL

查看:32
本文介绍了无法在 MySQL 中授予列特定权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

离开这个答案我正在执行以下语句

CREATE TABLE 人(id INT NOT NULL AUTO_INCREMENT,主键 (id));GRANT SELECT ON person(id) to SomeOne;

但是当我这样做时,我收到以下错误:

<块引用>

ERROR 1064 (42000):您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以获取在第 1 行的(id) TO SomeOne"附近使用的正确语法

有人可以解释为什么我会收到此错误.

MySQL 版本:

<块引用><块引用>

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

解决方案

GRANT SELECT (id) ON person TO SomeOne;

查看文档此处了解更多详情.>

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 person TO SomeOne;

Check the documentation here for more details.

这篇关于无法在 MySQL 中授予列特定权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆