用户管理

User management is the process of controlling which users are allowed to connect to the MySQL server and what permissions they have on each database. phpMyAdmin does not handle user management, rather it passes the username and password on to MySQL, which then determines whether a user is permitted to perform a particular action. Within phpMyAdmin, administrators have full control over creating users, viewing and editing privileges for existing users, and removing users.

在 phpMyAdmin 中,用户管理是在主页的 :guilabel`用户账户` 标签下控制的。用户可以被创建、编辑或删除。

创建新用户

To create a new user, click the Add user account link near the bottom of the User accounts page (you must be a “superuser”, e.g., user “root”). Use the textboxes and drop-downs to configure the user to your particular needs. You can then select whether to create a database for that user and grant specific global privileges. Once you’ve created the user (by clicking Go), you can define that user’s permissions on a specific database (don’t grant global privileges in that case). In general, users do not need any global privileges (other than USAGE), only permissions for their specific database.

添加已有的用户

To edit an existing user, simply click the pencil icon to the right of that user in the User accounts page. You can then edit their global- and database-specific privileges, change their password, or even copy those privileges to a new user.

删除用户

From the User accounts page, check the checkbox for the user you wish to remove, select whether or not to also remove any databases of the same name (if they exist), and click Go.

赋予用户特定数据库的权限

Users are assigned to databases by editing the user record (from the User accounts link on the home page). If you are creating a user specifically for a given table you will have to create the user first (with no global privileges) and then go back and edit that user to add the table and privileges for the individual table.

可配置菜单和用户组

通过启用 $cfg['Servers'][$i]['users']$cfg['Servers'][$i]['usergroups'] 可以自定义用户在 phpMyAdmin 导航中看到的内容。

警告

这个功能只是限制了用户看到的东西,他们仍然能够使用所有的功能。因此,这不能被认为是一种安全限制。如果你想限制用户能做什么,可以使用 MySQL 权限来实现。

With this feature enabled, the User accounts management interface gains a second tab for managing User groups, where you can define what each group will view (see image below) and you can then assign each user to one of these groups. Users will be presented with a simplified user interface, which might be useful for inexperienced users who could be overwhelmed by all the features phpMyAdmin provides.

_images/usergroups.png