将数据库.表上的删除权限授予用户名@'%';
我已授予用户对数据库中一张表的完全控制权。但看起来他们无法删除记录。
我作为特权用户尝试过:
GRANT DELETE ON databasename.tablename TO username@'%';
flush privileges;
但是删除 stil 不起作用 有
ERROR 1142 (42000): DELETE command denied to user 'username'@'localhost' for table 'tablename'
什么想法吗?
干杯,
内森。
I have given a user full control over one table in a database. Hoever it appears they cant delete records.
I've tried as a privilaged user:
GRANT DELETE ON databasename.tablename TO username@'%';
flush privileges;
But delete stil doesn't work
ERROR 1142 (42000): DELETE command denied to user 'username'@'localhost' for table 'tablename'
Any ideas?
Cheers,
Nathan.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的 GRANT 语句可能需要为用户名添加额外的引号:
'username'@'%'
。您可以在
mysql
数据库中检查用户的权限。检查表user
、db
、hosts
、tables_priv
。您可能有具有相同用户名和不同主机名的条目,例如“用户名”@“localhost”和“用户名”@“%”。
MySQL 文档描述了 MySQL 评估这些表的顺序:
http: //dev.mysql.com/doc/refman/5.1/en/request-access.html
如果表
tables_priv
中有一个条目允许用户DELETE< /code>,通常就足够了。
AFAIK 您不需要在
GRANT
之后运行FLUSH PRIVILEGES
- 如果您使用 INSERT、DELETE 手动修改权限表,则只需要FLUSH
ETC。Your GRANT statement might need additional quotes for the username:
'username'@'%'
.You can check the user's privileges in the
mysql
database. Check the tablesuser
,db
,hosts
,tables_priv
.You might have entries with the same username and different hostnames, like 'username'@'localhost' and 'username'@'%'.
The MySQL-Documentation describes in which order MySQL evaluates these tables:
http://dev.mysql.com/doc/refman/5.1/en/request-access.html
If you have an entry in the table
tables_priv
allowing the user toDELETE
, that should normally be sufficient.AFAIK you do not need to run
FLUSH PRIVILEGES
after aGRANT
- you only need toFLUSH
if you modify the privilege tables manually with INSERT,DELETE etc.您可以尝试以下操作:
可能您的 mySQL 工作台不允许当前用户的全局权限上的删除功能
转到管理 - 用户和权限 >选择用户帐户>转到管理角色选项卡 >然后在全局权限上检查删除。
You might try this:
May be your mySQL workbench does not allow the delete function on Global Privilege on your current user
Go to Administration - User and Privilege > Select User Account > Go to Administrative Roles Tab > then on Global Privileges check the DELETE.