授予名为“ Grant”的用户的特权?

问题描述 投票:0回答:2
CREATE USER 'Grant'@'localhost' IDENTIFIED BY 'bestpasswordever';

我如何向名为“授予”的用户授予权限?它引发错误。

GRANT INSERT, DELETE
ON table
TO Grant@localhost;
mysql sql grant
2个回答
0
投票
GRANT INSERT,DELETE
ON table
TO 'Grant'@'localhost';

请参见文档中的Section 6.2.4 (Specifying Account Names)

帐户名语法为'user_name'@'host_name'。


-1
投票

[当使用保留的关键字或带有非法字符的标识符作为标识符时,必须使用反引号

GRANT INSERT, DELETE
ON table
TO `Grant`@localhost;
© www.soinside.com 2019 - 2024. All rights reserved.