使用多个数据库和http auth配置phpMyAdmin? [英] Configure phpMyAdmin with multiple databases and http auth?

查看:85
本文介绍了使用多个数据库和http auth配置phpMyAdmin?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将phpMyAdmin配置为访问多个mysql服务器,并使用 http auth登录名(使用mysql数据库登录名)。但是,它似乎不起作用,我不确定是否可行?当然,我首先会阅读许多文档,论坛和网页,而没有任何有关tihs的信息。

I want to configure phpMyAdmin to access multiple mysql servers, and use "http auth" login (with mysql database login). However it does not seem to work and I am not sure if it is possible or not ? Of course I first have read dozens of documentations, forums, and webpages without any information on tihs.

这是我的配置(仅适用于第一台服务器):

This is my configuration (works with the first server only) :

/* Server: svrdb01 [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'svrdb01';
$cfg['Servers'][$i]['host'] = '10.128.1.1';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['auth_http_realm'] = 'Login MySQL 1';
/* Server: svrdb02 [2] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'svrdb02';
$cfg['Servers'][$i]['host'] = '10.128.1.2';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['auth_http_realm'] = 'Login MySQL 2';
/* Server: svrdb04 [3] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'svrdb04';
$cfg['Servers'][$i]['host'] = '10.128.1.4';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['auth_http_realm'] = 'Login MySQL 3';

任何帮助都是有用的,尤其是在以下3个问题上:

Any help would be useful, especially on these 3 questions :


  1. 是否可以使用该逻辑配置phpMyAdmin?

  2. 如果可以,phpMyAdmin会尝试在每个连续的服务器上登录直到成功吗? / li>
  3. 如果没有,是否还有另一种方法让phpMyAdmin在多个服务器上使用MySQL登录?

非常感谢您的帮助...

Thanks a lot for your help...

P。 S.我已经在serverfault上问过这个问题,但是没有人能够回答这个问题,我得到一票否决,没有任何解释。我希望stackoverflow上的某人能够回答问题(或告诉我我的问题是什么)。

P. S. I asked that question on serverfault already but nobody was able to answer the question and I got one downvote without any explanation. I hope someone on stackoverflow will be able to answer the question (or tell me what's wrong with my question).

推荐答案

您说过此配置文件仅适用于第一台服务器-究竟是什么意思?尝试切换到其他服务器时,您会收到错误消息吗?您是否希望在登录前提示您询问要连接到哪个服务器?我很好奇,因为这似乎对我有用,但是该界面与auth_type cookie使用的界面不同,这可能会造成混淆。

You said this configuration file "works with the first server only" - what does that mean exactly? Do you get an error when trying to change to the other servers? Are you expecting a prompt before login to ask you which server you wish to connect to? I'm curious because this seems to work for me, but the interface is different than the one used by auth_type cookie which might be confusing.

使用auth_type cookie,登录第一页上的表单包含用户名,密码和用于选择主机的下拉列表的字段。使用auth_type http,您将获得HTTP浏览器登录页面的用户名和密码,并且必须在此处输入第一台服务器的用户名或密码。然后,一旦连接到第一台服务器,您就可以使用导航窗格中的服务器下拉列表来选择另一台服务器(此下拉列表也与其他auth_types一起出现)。我发现这种方法不太方便,因为在连接到其他服务器之前,我必须先连接到第一台服务器,所以我使用auth_type cookie(这也使我可以注销,并在出现问题时提供更好的错误报告)。

With auth_type cookie, the login form on the first page has fields for username, password, and a dropdown for selecting the host. With auth_type http, you get the HTTP browser login page for username and password, and have to enter the username or password for the first server here. Then, once connected to the first server, the you can use the server dropdown in the navigation pane to pick another server (this dropdown also appears with the other auth_types). I find this less convenient because I first have to connect to my first server before connecting to a different one, so I use auth_type cookie (which also lets me log out and gives better error reporting when something goes wrong).

您可以通过输入自定义网址(或添加一个书签);类似于 https://localhost/phpmyadmin/index.php?server = 5 ,但是,即使这样似乎也要求同时对两台服务器(1和5)进行身份验证,然后才能实际执行任何操作。

You could force the server by entering a customized URL (or bookmarking one); something like https://localhost/phpmyadmin/index.php?server=5, but even that seems to require authenticating to both servers (1 and 5) before I can actually do anything.

要直接回答您的问题:


是否可以使用该逻辑配置phpMyAdmin?

Is it possible to configure phpMyAdmin with that logic ?

当然,


如果是,phpMyAdmin会尝试在每台后续服务器上登录直到成功吗?

If yes, will phpMyAdmin try the login on each successive server until success ?

否,您必须先登录第一台服务器,然后跳至要连接的另一台服务器。

No, you have to log in to the first server, then jump to the other server to which you wish to connect.


如果没有,是否还有另一种方法让phpMyAdmin在多个服务器上使用MySQL登录?

If not, is there another way to have phpMyAdmin use the MySQL login with multiple servers ?

auth_type cookie是最好的,但是即使您知道限制,即使使用auth_type http也可以s并愿意解决它们。

auth_type cookie is the best, but even using auth_type http works as long as you're aware of the limitations and are willing to work around them.

总而言之,我建议切换到auth_type cookie,因为我发现它最容易使用。

In summary, I suggest switching to auth_type cookie because I find that easiest to work with.

这篇关于使用多个数据库和http auth配置phpMyAdmin?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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