phpmyadmin连接,管理多个mysql服务器

本文转自大神海地苍鹰的博文:http://blog.51yip.com/mysql/1250.html 的方法2

只为自己加深印象,如有同转,纯属激情

直接修改配置文件即可

cp  phpmyadmin/config.inc.php  phpmyadmin/config.inc.php.bk
vim phpmyadmin/config.inc.php
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * phpMyAdmin sample configuration, you can use it as base for
 * manual configuration. For easier setup you can use setup/
 *
 * All directives are explained in documentation in the doc/ folder
 * or at <http://docs.phpmyadmin.net/>.
 *
 * @package PhpMyAdmin
 */
 $connect_hosts = array( 
            '1'=>array( 
                 "host"   => "192.168.0.180",  
                 "user"   => "root", 
                 "password" => "" 
                 ), 
            '2' => array( 
                 "host"   => "192.168.0.181", 
                 "user"   => "m2", 
                 "password" => "m2" 
                 ) 
            ); 
      
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]['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'; 
      
}



你可能感兴趣的:(phpMyAdmin)