我在此位置安裝了phpmyadmin
/usr/share/phpmyadmin
。數據庫正在本地主機上運行。所以,我可以從phpmyadmin訪問數據庫而不做任何更改。我想要將localhost更改爲不同的主機或添加其他主機。更改phpmyadmin中的配置文件
對於這一點,我試圖改變config.inc.php
文件,並添加如下代碼:
$i++;
$cfg['Servers'][$i]['host'] = 'xxx-east-1.rds.amazonaws.com';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['compress'] = FALSE;
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'xxx';
$cfg['Servers'][$i]['password'] = 'xxx';
但是,它不與主機連接。我應該在哪裏改變這些信息?
我注意到的一個奇怪的事情是當我刪除config.inc.php
時,仍然有phpmyadmin
在工作。但是,可能是因爲localhost的默認設置。
當一切都失敗總是有'phpMyAdmin'手動 – RiggsFolly
或者搜索棧https://askubuntu.com/questions/19973/how-to-configure-phpmyadmin-to-access-multiple-servers – RiggsFolly
' $ cfg ['Servers'] [$ i] ['extension'] ='mysql';'可能需要更改爲'$ cfg ['Servers'] [$ i] ['extension'] ='mysqli';' – RiggsFolly