GRANTPRIVILEGES 是否会覆盖现有的用户和密码?

发布于 2024-12-26 12:40:21 字数 181 浏览 1 评论 0原文

是否执行以下命令:

GRANT ALL PRIVILEGES ON myblog.* TO "wordpress"@"localhost" IDENTIFIED BY "summer";

如果执行,则设置一个新密码,当已经存在密码为 Winter 的用户 wordpress 时?

Does the following command:

GRANT ALL PRIVILEGES ON myblog.* TO "wordpress"@"localhost" IDENTIFIED BY "summer";

If executed, set a new password, when there is already an existing user wordpress with password winter?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

若言繁花未落 2025-01-02 12:40:21

是的,确实如此。

当存在 IDENTIFIED BY 子句并且您具有全局授予权限时,密码将成为该帐户的新密码,即使该帐户存在并且已经有密码。如果没有 IDENTIFIED BY 子句,帐户密码将保持不变。

引自 MySQL 文档

Yes, it does.

When the IDENTIFIED BY clause is present and you have global grant privileges, the password becomes the new password for the account, even if the account exists and already has a password. With no IDENTIFIED BY clause, the account password remains unchanged.

Quoted from MySQL documentation

桃酥萝莉 2025-01-02 12:40:21

当存在 IDENTIFIED BY 子句并且您具有全局授予权限时,密码将成为该帐户的新密码,即使该帐户存在并且已经有密码。如果没有 IDENTIFIED BY 子句,帐户密码将保持不变。

来自: MySql 文档

When the IDENTIFIED BY clause is present and you have global grant privileges, the password becomes the new password for the account, even if the account exists and already has a password. With no IDENTIFIED BY clause, the account password remains unchanged.

From: MySql doc

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