Ubuntu phpMyAdmin and Multiple Servers_MySQL
I've been playing around with Ubuntu 14.04 since it came out a few weeks (days?) ago. One thing I needed was to be able to use phpMyAdmin to access multiple development MySQL servers. Since I haven't found very good documentation on this, I wanted to post it here so that it hopefully helps others.
Note that I won't help with MySQL privileges here. I'll assume you just want the same setup as I have: 1 LAMP server, several MySQL servers with remote root access. You'll have to verify that you can actually access the MySQL servers remotely as root.
Install phpMyAdmin
So first, install phpMyAdmin:
sudo apt-get updatesudo apt-get install phpmyadmin
It'll ask you a bunch of questions. Since the MySQL servers are remote, just say "No" to any database question. For the web server question, choose the one you used (most probably Apache).
Copy and Configure
Next, just copy the sample configuration Ubuntu includes for multiple hosts:
sudo cp /usr/share/doc/phpmyadmin/examples/config.manyhosts.inc.php /etc/phpmyadmin/conf.d
That will copy the file into /etc/phpmyadmin/conf.d/ which I assume won't be blown away by an Ubuntu phpMyAdmin update. Then edit the file and change the $hosts array to whatever your servers' hostnames or IP addresses are.
$hosts = array ("db01.example.com","db02.example.com",
);
These will be listed in a dropdown box below the Username/Password fields.
That's it! Since I setup my development MySQL servers without a root password, I added the following before the last brace:
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
You should follow me onTwitter.
推荐阅读
-
Ubuntu查看修改mysql的登录名和密码、安装phpmyadmin
-
解析阿里云ubuntu12.04环境下配置Apache+PHP+PHPmyadmin+MYsql
-
Ubuntu 18.04上安装 phpMyAdmin的详细教程
-
Ubuntu 17.10安装phpMyAdmin数据库管理工具配置详解
-
Ubuntu 17.10安装phpMyAdmin数据库管理工具
-
Ubuntu上安装LAMP及phpmyadmin
-
Ubuntu phpMyAdmin and Multiple Servers_MySQL
-
#1045无法登录phpmyadmin,连接不上mysql服务器,先把ubuntu安装
-
Ubuntu 停 配置 LAMP 和 PHPMyadmin
-
mysql - Ubuntu下安装的phpmyadmin打开页面空白?