Adding Multiple MySQL Database Server In Single PhpMyAdmin Installation

Hi Friends, In my previous article I explained How to configure and install PhpMyAdmin. In previous post we saw PhpMyAdmin allows only to connect to localhost MySQL server because of it’s default configuration. Suppose if we have multiple database so it is very time consuming and difficult task to install PhpMyAdmin and manage it. It would be great if we have only one PhpMyAdmin to manage all databases. Just choose which server you want to connect from single PhpMyAdmin Installation. In this article I am going to explain how we can add multiple MySQL databases in single PhpMyAdmin installation.

After successfully PhpMyAdmin installation on our system we are going to manage multiple MySQL server from one phpMyadmin installation.

Before going to add multiple host make sure you have all MySQL credential like Host, IP, Port, Database Name, Database User and Database Password etc..

Than navigate to phpMyAdmin install Directory location. In my case my phpMyAdmin directory location is “/usr/share/phpMyAdmin” it is also phpMyAdmin default location.

Now go to phpMyadmin installed directory.

# cd /usr/share/phpMyAdmin
# cp

Please Note” file will be available below phpMyAdmin 4.0 version. If you are using above 4.0 you will need directly edit “ “ which is located at /etc/phpMyAdmin/ location.

Edit /usr/share/phpMyAdmin/ – For below phpMyadmin 4.0 version.

Edit /etc/phpMyAdmin/ – For Above phpMyadmin 4.0 version.

In my case I am using phpMyAdmin 4.0 version.

Check phpMyAdmin version

# rpm -qa | grep -i phpmyadmin


So will need to edit /etc/phpMyAdmin/ file.

# cd /etc/phpMyAdmin/

# vim

Now you will need to add the below line at the end of file.

#My Remote Databases
$cfg['Servers'][$i]['verbose'] = 'Database-Server';
$cfg['Servers'][$i]['host'] = '';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';

Adding above entries in config file save it and access phpMyadmin page in web browser. You can see server choice option on the page.


Here select server name which you need to connect and access databases.

I hope this article will be helpful to add multiple MySQL databases in single phpMyAdmin installation . If you have any queries and problem please comment in comment section.


Thank you! for visiting LookLinux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website To become an author at LookLinux Submit Article. Stay connected to Facebook.

About the author


Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

1 Comment

Leave a Comment