如何为多个用户配置 phpMyAdmin - 每个用户只能访问他们的数据库 [英] How to configure phpMyAdmin for multiple users - each with access to their database only

查看:40
本文介绍了如何为多个用户配置 phpMyAdmin - 每个用户只能访问他们的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 phpMyAdmin 配置为能够接受几种不同的用户帐户登录之一.每个用户都将被分配一个特定的数据库,并且只能访问该数据库.

I want to configure phpMyAdmin to be able to accept one of several different user account logins. Each user would be allocated a specific database and only have access to that.

phpMyAdmin 的默认配置是一个超级用户,例如root 可以访问服务器上的每个数据库.

The default configuration with phpMyAdmin is one super user, e.g. root which has access to every database on the server.

我需要能够让人们访问某些数据库,但不是全部.

I need to be able to give people access to certain database(s) but not all.

你可以吗

  1. 提供解决方案
  2. 使用下面的现有解决方案评论我的发现,必须对其进行调整才能正常工作

以下解决方案有效 - 增加一个步骤(如下所述):http://alandoyle.com/tutorials/configuring-phpmyadmin-for-multiple-用户/

The following solution works - with an additional step (described below): http://alandoyle.com/tutorials/configuring-phpmyadmin-for-multiple-users/

额外的步骤是首先假设你已经设置了一个 mysql 用户和密码,例如'anotheruser' 并将此用户与数据库相关联 - 即将此用户添加到可以访问该数据库的用户列表中.

The additional steps are to first assume you've setup a mysql user and password, e.g. 'anotheruser' and associated this user with a database - i.e. added this user to the list of users that can access that database.

第二步是再次运行上述解决方案页面中引用的SQL查询块(已经运行一次后,按照原文的指示,几乎是引用的(显然确保使用正确的密码))) 但这次是针对您要授予访问权限的实际用户.因此,如果您的用户名是anotheruser",那么您将 pma 替换为 anotheruser,将 pmapassword 替换为 anotheruser 的密码.

The 2nd additional step is to run the SQL query block quoted in the page of the above solution again (after already running it once, as instructed in the original text, pretty much as quoted (obviously making sure the correct password is used)) but this time for the actual user you want to give access. So if your user name is 'anotheruser', then you replace pma with anotheruser and pmapassword with the password for anotheruser.

因此,连同所有说明,这似乎都有效.这样看来,每次添加新用户时,都必须为新用户运行相同的 SQL 查询.但我从解决方案中得到的印象是,这是一个一次性 SQL 查询,支持通过 phpmyadmin ui 添加任意数量的用户并将它们添加到数据库中.想法?

So together with all the instructions this seems to work. It would appear then that each time a new user is to be added, that same SQL query has to be run for the new user. But the impression I got from the solution was that this was a one off SQL query to support adding any number of users and adding them to databases via the phpmyadmin ui. Thoughts?

在 SO 上查看的其他解决方案(但不是我需要的):

Other solutions looked at on SO (but not quite what I need):

推荐答案

使用这个

  $cfg['Servers'][$i]['auth_type'] = 'cookie';

代替

  $cfg['Servers'][$i]['auth_type'] = 'config';

在您的 config.inc.php 中并重新启动服务,然后将为所有用户启动身份验证过程,他们可以根据那里的授权进行工作.

in your config.inc.php and restart services then authentication process will start for all users and they can do work according to there grants.

这篇关于如何为多个用户配置 phpMyAdmin - 每个用户只能访问他们的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆