MySQL:GRANT 影响 0 行是错误还是有意为之?
我成功地授予用户对特定数据库的有限权限...
C:\mysql\>mysql -uroot -p
输入密码:
欢迎使用 MySQL 监视器。命令以 ; 结尾或\g。
GRANT SELECT, INSERT ON jabcre5_examplecom.* TO 'test1'@'localhost';
查询正常,0 行受影响(0.00 秒)
...我被“0 行受影响”搞砸了。检查完所有内容后,用户确实拥有我分配给它的权限,所以...
“0 行受影响”是错误还是设计使然?
我问这个的原因是因为没有专门的问题来澄清这一点,因为我试图尽可能彻底地回答我的问题,我经常发现我的问题会被其他人质疑,所以一个可靠的答案肯定会节省一些人的时间质疑自己并仅通过一两个快速查询来测试他们的用户/数据库。
我已经用错误标记了这个问题,因为这肯定是我意想不到的行为。
I was successfully able to grant a user limited permissions to a specific database...
C:\mysql\>mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
GRANT SELECT, INSERT ON jabcre5_examplecom.* TO 'test1'@'localhost';
Query OK, 0 rows affected (0.00 sec)
...I was thrown off by "0 rows affected". After checking everything the user did have the permissions that I had assigned it so...
Is "0 rows affected" a bug or by design?
The reason I am asking this is because there is no question dedicated to clarifying this, since I try to be as thorough as possible I often find what I question to be questioned by others so a solid answer would certainly save some people the time of having to question themselves and merely test out their user/database with a quick query or two.
I've tagged this question with bug as this was certainly unexpected behavior by me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据设计,请参阅 http://dev.mysql.com 上的用户评论/doc/refman/5.0/en/grant.html
By design, see the user comments at http://dev.mysql.com/doc/refman/5.0/en/grant.html
是的,按照设计,从 MySQL 错误报告中得到证实......
http://bugs.mysql.com/bug.php?id=64313
Yes, by design, confirmed from a MySQL bug report here...
http://bugs.mysql.com/bug.php?id=64313