phpmyadmin管理多个数据库服务器的配置方法

来源:互联网 发布:锐捷端口聚合命令 编辑:程序博客网 时间:2024/05/18 01:40

修改config.inc.php文件

 //如果要管理,更多个mysql服务器,就修改$connect_hosts这个数组就行了

 $connect_hosts = array(
            '1'=>array(
                 "host"   => "localhost",  //服务器1
                 "user"   => "root",
                 "password" => ""
                 ),
            '2' => array(
                 "host"   => "192.168.0.11", //服务器2
                 "user"   => "wordpress",
                 "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'];   //修改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]['AllowNoPassword'] = true;
 $cfg['Servers'][$i]['user'] = $connect_hosts[$i]['user'];  //修改用户名
 $cfg['Servers'][$i]['password'] = $connect_hosts[$i]['password']; //密码
 /* rajk - for blobstreaming */
 $cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
 $cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
 $cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
 $cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';


}