错误消息指出“SQL语法错误NEAR'表,alter table,...”没有错误号码
CREATE USER admin@localhost IDENTIFIED BY 'password'; GRANT select, update, insert, delete, create table, alter table, drop table, create index, drop index, create routine, create procedure, create function ON test.* TO admin@localhost;*我试图授予的所有项目都是有效的权限,但当它到达列表中的第一个“表”时,它只是不喜欢它,我错过了什么或者是否存在我不理解的冲突。
TIA
Error message states "SQL syntax error NEAR 'table, alter table,..." NO ERROR NUMBER GIVEN
CREATE USER admin@localhost IDENTIFIED BY 'password'; GRANT select, update, insert, delete, create table, alter table, drop table, create index, drop index, create routine, create procedure, create function ON test.* TO admin@localhost;*All of the items I am trying to grant are valid permissions but when it gets to the first "table" in the list it just does not like it, am I missing something or is there a conflict that I just don't understand.
TIA
最满意答案
不需要table :
GRANT select, update, insert, delete, create, alter, drop ON test.* TO admin@localhost;我不确定如何添加程序,功能权限,我会找到它。
如fvu所述,你可以找到授权权限MySQL手册。 特别是对于PROCEDURE, http://dev.mysql.com/doc/refman/5.5/en/grant.html#grant-routine-privileges
更新
我已经阅读了你对你的问题的评论。 output is from SHOW GRANTS ... 我用谷歌搜索了它。 SHOW GRANTS的输出看起来可以直接在MySQL中运行。 但它不能。 (这个事实我只是不知道。谢谢)
以及如何找到你想要的东西......你能试试吗?:
SELECT * FROM information_schema.USER_PRIVILEGES WHERE GRANTEE = 'user_id@hosname';你可以看到user @ hostname有哪些真正的权限...好。 但很难制作GRANT ... Percona有这样一个有趣的功能:
SELECT sql_grants FROM common_schema.sql_show_grants;我发现了这个问题 。
非常感谢! 我已经为你的问题学到了很多技巧!
table is not needed:
GRANT select, update, insert, delete, create, alter, drop ON test.* TO admin@localhost;I'm not sure about that how to add procedure, function privileges, I'll find it.
as fvu mentioned, you can find grant privileges MySQL Manual. especially for PROCEDURE, http://dev.mysql.com/doc/refman/5.5/en/grant.html#grant-routine-privileges
UPDATED
I have read your comment on your question. output is from SHOW GRANTS .... I have googled about it. output of SHOW GRANTS looks like that can run directly in MySQL. but it can't. (this fact I just didn't know. thanks)
and how to find something like you want... can you try this?:
SELECT * FROM information_schema.USER_PRIVILEGES WHERE GRANTEE = 'user_id@hosname';You can see which real privileges name user@hostname has... good. but hard to make GRANT ... Percona has interesting feature like this:
SELECT sql_grants FROM common_schema.sql_show_grants;I found it this question.
Thanks alot! I have learned many skills for your question!!!
更多推荐
发布评论