Plesk 上的单个 MySQL 数据库用户名

发布于 2024-07-17 14:44:32 字数 1459 浏览 3 评论 0原文

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

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

发布评论

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

评论(3

暮年慕年 2024-07-24 14:44:33

除了通过 GRANT ALL 实际授予用户权限之外,您还需要向 Plesk 数据库中的 db_users 表添加一条记录。 使用shell查看所有数据库,我发现plesk数据库名为psa。 从 accounts 查找 accountid 并从 data_bases 查找 dbid

INSERT into db_users VALUES('','username','accountid','dbid');

In addition to actually granting the user permissions via GRANT ALL, you'll need to add a record to the db_users table in the Plesk database. Using shell to see all databases, I found the plesk database was named psa. Lookup accountid from accounts and dbid from data_bases

INSERT into db_users VALUES('','username','accountid','dbid');
权谋诡计 2024-07-24 14:44:32

2014 年 1 月 10 日更新 Plesk 11.5 具有以下功能:
在此处输入图像描述

这可能很烦人,但这是为了更好的安全性。 通用用户名和登录名可能更容易记住,但不安全。 如果您的系统管理员已经这样做了,那么它是有原因的。

请通常允许您单独创建用户名和数据库。 所以你可以对多个batbase使用相同的用户名。

Update 10 Jan 2014 Plesk 11.5 has such functional from the box:
enter image description here

This may be annoying but it is for better security. Universal Username and Login might be easier to remeber but not secure. If your system admin has done then it is done for reason.

Please usually allows you to create username and databases seperately. So you can use the same username for multiple batabases.

合久必婚 2024-07-24 14:44:32

使用 GRANT 语法,您可以授予单个 MySQL 用户帐户如果您愿意,可以使用相同的密码访问任意数量的数据库。

GRANT ALL ON mydb.* TO 'user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON mydbtwo.* TO 'user'@'localhost' IDENTIFIED BY 'password';

如果您想创建一个始终可以访问所有数据库的用户,非常类似于 root 用户,您可以使用如下语法:

GRANT ALL ON *.* TO 'someuser'@'somehost' IDENTIFIED BY 'password';

不建议在项目之间共享相同的用户名和密码,但您绝对可以这样做。

Using GRANT syntax, you can give a single MySQL user account access to as many databases as you want, with the same password if you'd like.

GRANT ALL ON mydb.* TO 'user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON mydbtwo.* TO 'user'@'localhost' IDENTIFIED BY 'password';

If you wanted to create a user that always has access to all the databases, very much like the root user, you can use syntax like this:

GRANT ALL ON *.* TO 'someuser'@'somehost' IDENTIFIED BY 'password';

It's not recommended to share the same username and password across projects, but you can definitely do it.

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