2012-05-03 22 views

回答

15

看看這個:

http://www.onlinehowto.net/config-multiple-servers-in-phpmyadmin/1405 

/* Single server config section */ 
$i++; 
/* Authentication type */ 
$cfg['Servers'][$i]['auth_type'] = 'cookie'; 
/* Server parameters */ 
$cfg['Servers'][$i]['host'] = 'dbsub'; 
$cfg['Servers'][$i]['connect_type'] = 'tcp'; 
$cfg['Servers'][$i]['compress'] = false; 
/* Select mysqli if your server has it */ 
$cfg['Servers'][$i]['extension'] = 'mysql'; 

上述六個行代碼配置的phpMyAdmin連接到一臺服務器。注意在第一行$ i ++中增加的i>變量。要定義另一臺服務器,只需複製粘貼上面的塊並更改主機名即可。在每個數據庫服務器配置之前安裝$ i ++語句非常重要。服務器也可以來自不同的數據庫類型。例如MySQL和PostgreSQL。這就是爲什麼PhpMyAdmin如此受歡迎和喜愛。

這裏在登錄卵石工作建立在phpMyAdmin的情況下,我們管理

/* 
* Servers configuration 
*/ 
$i = 0; 

/* 
* First server 
*/ 
$i++; 
/* Authentication type */ 
$cfg['Servers'][$i]['auth_type'] = 'cookie'; 
/* Server parameters */ 
$cfg['Servers'][$i]['host'] = 'db'; 
$cfg['Servers'][$i]['connect_type'] = 'tcp'; 
$cfg['Servers'][$i]['compress'] = false; 
/* Select mysqli if your server has it */ 
$cfg['Servers'][$i]['extension'] = 'mysql'; 
/* 
* Second server 
*/ 
$i++; 
/* Authentication type */ 
$cfg['Servers'][$i]['auth_type'] = 'cookie'; 
/* Server parameters */ 
$cfg['Servers'][$i]['host'] = 'dbsub'; 
$cfg['Servers'][$i]['connect_type'] = 'tcp'; 
$cfg['Servers'][$i]['compress'] = false; 
/* Select mysqli if your server has it */ 
$cfg['Servers'][$i]['extension'] = 'mysql'; 
/* 
* Third server 
*/ 
$i++; 
/* Authentication type */ 
$cfg['Servers'][$i]['auth_type'] = 'cookie'; 
/* Server parameters */ 
$cfg['Servers'][$i]['host'] = 'stats1'; 
$cfg['Servers'][$i]['connect_type'] = 'tcp'; 
$cfg['Servers'][$i]['compress'] = false; 
/* Select mysqli if your server has it */ 
$cfg['Servers'][$i]['extension'] = 'mysql'; 

$cfg['DisplayServersList'] = TRUE; 

/* 
* End of servers configuration 

最後的變化,這將使服務器列表中的一個顯示在一個不錯的下拉列表中$ cfg [''DisplayServersList''] = TRUE;聲明。這樣,無論何時您進入phpmyadmin的登錄頁面,您都必須選擇您想要使用的服務器。

+1

感謝兄弟。這是工作。不知道,爲什麼你倒退了? O_O –

2

在您的PHPMyAdmin的根目錄下,您有一個名爲config.sample.inc.php的文件。

將它重命名爲config.inc.php並編輯它!

搜索第一服務器$ CFG樁[ '服務器'] [$ i] [ '主機']設置了正確的價值。

/* 
* First server 
*/ 
$i++; 
/* Authentication type */ 
$cfg['Servers'][$i]['auth_type'] = 'cookie'; 
/* Server parameters */ 
$cfg['Servers'][$i]['host'] = '192.168.0.1'; 
$cfg['Servers'][$i]['connect_type'] = 'tcp'; 
$cfg['Servers'][$i]['compress'] = false; 
$cfg['Servers'][$i]['AllowNoPassword'] = false; 
相關問題