MySQL:GRANT 影响 0 行是错误还是有意为之?

发布于 2025-01-05 05:09:08 字数 541 浏览 0 评论 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

双马尾 2025-01-12 05:09:08

是的,按照设计,从 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文