phpmyadmin管理多个数据库服务器的配置方法 - 李高峰的博客 - CSDN博客

在开发中有3台数据库服务器需要访问和管理,用客户端切换太过麻烦,直接用phpmyadmin来解决问题

修改根目录中的config.inc.php配置

$i = 0;

/*
 * 服务器A
 */
$i++;
/* Authentication type */
$cfg\['Servers'\]\[$i]['auth_type'] = 'config';
$cfg\['Servers'\]\[$i]['host'] = '127.0.0.1';
$cfg\['Servers'\]\[$i]['port'] = '3307';
$cfg\['Servers'\]\[$i]['connect_type'] = 'tcp';
$cfg\['Servers'\]\[$i]['compress'] = false;
$cfg\['Servers'\]\[$i]['extension'] = 'mysqli';
$cfg\['Servers'\]\[$i]['user'] = 'root';
$cfg\['Servers'\]\[$i]['password'] = '123456';
$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';

/*
 * 服务器B
 */
$i++;
$cfg\['Servers'\]\[$i]['auth_type'] = 'config';
$cfg\['Servers'\]\[$i]['host'] = '127.0.0.1';
$cfg\['Servers'\]\[$i]['port'] = '3308';
$cfg\['Servers'\]\[$i]['connect_type'] = 'tcp';
$cfg\['Servers'\]\[$i]['compress'] = false;
$cfg\['Servers'\]\[$i]['extension'] = 'mysqli';
$cfg\['Servers'\]\[$i]['user'] = 'root';
$cfg\['Servers'\]\[$i]['password'] = ‘123456';
$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';

/*
 * 服务器C
 */
$i++;
$cfg\['Servers'\]\[$i]['auth_type'] = 'config';
$cfg\['Servers'\]\[$i]['host'] = '127.0.0.1';
$cfg\['Servers'\]\[$i]['port'] = '3306';
$cfg\['Servers'\]\[$i]['connect_type'] = 'tcp';
$cfg\['Servers'\]\[$i]['compress'] = false;
$cfg\['Servers'\]\[$i]['extension'] = 'mysqli';
$cfg\['Servers'\]\[$i]['user'] = 'root';
$cfg\['Servers'\]\[$i]['password'] = '123456';
$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,在首页就可以看到服务器列表了

每次换开发环境都忘记上面的配置,这次直接从http://be-evil.org/post-138.html转到我的博客上记下了


Original url: Access
Created at: 2019-09-18 19:54:03
Category: default
Tags: none

请先后发表评论
  • 最新评论
  • 总共0条评论