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

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

问题描述

我想要配置phpMyAdmin能够接受几个不同的用户帐户登录之一。



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



我需要能够让用户访问某些数据库,但不是所有数据库。



您可以


  1. 提供解决方案



  2. 以下解决方案适用 - 额外步骤(描述)以下):
    http://alandoyle.com/tutorials/configuring -phpmyadmin-for-multiple-users /



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



    第二个附加步骤是运行SQL在上面的解决方案的页面中引用的查询块(在已经运行一次之后,按照原始文本中的说明,几乎引用(显然确保使用正确的密码))但是这次为实际的用户,给予访问。因此,如果您的用户名是anotheruser,那么您将pma替换为另一个用户,并将pmapassword替换为另一个用户的密码。



    因此,与所有说明相似。然后将出现每次要添加新用户时,必须为新用户运行相同的SQL查询。但我从解决方案得到的印象是,这是一个一次性SQL查询,以支持添加任何数量的用户,并通过phpmyadmin ui将它们添加到数据库。



    其他解决方案考虑了SO(但不是我需要的):




    解决方案

    使用此

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

    代替

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

    然后重新启动服务,那么身份验证过程将为所有用户启动,按照那里的工作。


    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.

    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.

    Could you either

    1. offer a solution
    2. comment on my findings with the existing solution below which had to be adjusted to properly work

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

    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.

    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.

    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?

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

    解决方案

    use this

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

    in place of

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

    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天全站免登陆