配置phpmyadmin管理多个mysql服务器

1,将phpMyAdmin根目录下的config.sample.inc.php,重命名为config.inc.php
2,修改config.inc.php文件,注意一点,数组下标不要从0开始,不然会提示错误的
[php]
$connect_hosts = array(
‘1’=>array(
"host" => "localhost", //服务器1
"user" => "report",
"password" => "report"
),
‘2’ => array(
"host" => "192.168.0.81", //服务器2
"user" => "test",
"password" => "*******"
)
);
for ($i=1;$i<=count($connect_hosts);$i++) {
/* Authentication type */
$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’;
/* Server parameters */
$cfg[‘Servers’][$i][‘host’] = $connect_hosts[$i][‘host’];
$cfg[‘Servers’][$i][‘connect_type’] = ‘tcp’;
$cfg[‘Servers’][$i][‘compress’] = false;
/* Select mysqli if your server has it */
$cfg[‘Servers’][$i][‘extension’] = ‘mysql’;
$cfg[‘Servers’][$i][‘user’] = $cfg[‘Servers’][$i][‘user’];
$cfg[‘Servers’][$i][‘password’] = $cfg[‘Servers’][$i][‘password’];
$cfg[‘Servers’][$i][‘AllowNoPassword’] = false;
}
[/php]

发布日期:
分类:Mysql

发表评论

邮箱地址不会被公开。 必填项已用*标注