Cha*_*ngh 6 php mysql phpmyadmin
我想知道是否可以在phpMyAdmin的登录屏幕上指定主机.
每当我需要连接到不同的服务器时,我必须编辑主机字段config.inc.php.
mil*_*nmk 16
看看这个:
http://www.onlinehowto.net/config-multiple-servers-in-phpmyadmin/1405
/* Single server config section */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'dbsub';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
Run Code Online (Sandbox Code Playgroud)
以上六行代码配置PhpMyAdmin连接到一台服务器.注意i>变量在第i行$ i ++上增加了.要定义另一台服务器,只需复制粘贴上面的块并更改主机名即可.在每个数据库服务器配置之前使用$ i ++语句非常重要.服务器也可以来自不同的数据库类型.例如MySQL和PostgreSQL.这就是PhpMyAdmin如此受欢迎和喜爱的原因.
这是我们管理的一个phpmyadmin实例中的工作设置
/*
* Servers configuration
*/
$i = 0;
/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'db';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
/*
* Second server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'dbsub';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
/*
* Third server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'stats1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['DisplayServersList'] = TRUE;
/*
* End of servers configuration
Run Code Online (Sandbox Code Playgroud)
将登录scree中的一个很好的下拉列表中显示的服务器列表的最终更改是$ cfg [''DisplayServersList''] = TRUE; 声明.这样,只要您进入phpmyadmin的登录页面,就必须选择要使用的服务器.
| 归档时间: |
|
| 查看次数: |
10547 次 |
| 最近记录: |