gpt4 book ai didi

mysql - 如果用户在连接到 MySQL 时被删除,会发生什么情况?

转载 作者:行者123 更新时间:2023-11-29 05:37:54 25 4
gpt4 key购买 nike

假设有一个 MySQL 用户 alice 当前连接到数据库。假设另一个用户 bob 在她还在工作时删除了 alice。会发生什么? bob 会失败吗? alice 会立即断开连接吗?她会在下一次查询时收到错误消息吗?或者她能像往常一样完成类(class)吗?

最佳答案

12.7.1.2. DROP USER Syntax :

DROP USER does not automatically close any open user sessions. Rather, in the event that a user with an open session is dropped, the statement does not take effect until that user's session is closed. Once the session is closed, the user is dropped, and that user's next attempt to log in will fail. This is by design.

...和5.4.6. When Privilege Changes Take Effect它在某种程度上是相关的:

If you modify the grant tables indirectly using account-management statements such as GRANT, REVOKE, or SET PASSWORD, the server notices these changes and loads the grant tables into memory again immediately.

关于mysql - 如果用户在连接到 MySQL 时被删除,会发生什么情况?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9193447/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com