phpMyAdmin配置管理多個數據庫服務器方法

用了好幾個第三方軟件,最後還是喜歡用phpMyAdmin

1.打開phpMyadmin目錄,找到config.inc.php,若不存在,將config.sample.inc .php更名爲config.inc.php
2.將以下代碼註釋或刪除
在這裏插入圖片描述
3.改成以下內容即可:

/**
 * Servers configuration
 */
$server_hosts = array(
	'1' => array('server_name' => 'localhost', 'host' => '127.0.0.1', 'user'=>'', 'password' => ''),
	'2' => array('server_name' => 'test', 'host' => 'xxx.xxx.x.xx', 'user'=>'', 'password' => ''),
	'3' => array('server_name' => 'test2', 'host' => 'xxx.xxx.x.xxx', 'user'=>'', 'password' => '')
);

foreach($server_hosts as $key => $sh)
{
	$cfg['Servers'][$key]['verbose'] = $sh['server_name'];
	$cfg['Servers'][$key]['auth_type'] = 'cookie';
	$cfg['Servers'][$key]['host'] = $sh['host'];
	$cfg['Servers'][$key]['user'] = $sh['user']; 
	$cfg['Servers'][$key]['password'] = $sh['password'];
	$cfg['Servers'][$key]['connect_type'] = 'tcp';
	$cfg['Servers'][$key]['compress'] = false;
	$cfg['Servers'][$key]['extension'] = 'mysqli';
	$cfg['Servers'][$key]['AllowNoPassword'] = false;
}
$cfg['ServerDefault'] = 1;

4.保存、重啓

5.效果:
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章