Awesome Tools Linux Tutorials

How To Install phpMyAdmin For Multiple Hosts On CentOS/RHEL/Ubuntu

In the previous article, we learned to install phpMyAdmin for single host only. But when there are multiple hosts or multiple MySQL servers, then sometimes we need to manage these several databases servers from a single place. Well by end of this tutorial you will be able to choose/connect/manage multiple databases hosts with phpMyAdmin. You will see a list of other databases hosts/servers in a drop down list.

When you install phpMyAdmin on your Linux/Windows systems, In most of the cases default installation dir is /usr/share/phpMyAdmin or /usr/share/phpmyadmin. But in the previous article of phpMyAdmin installation my dir was /var/www/html/phpmyadmin.  You can do modify commands of this tutorial accordingly.

In This Scenario:

phpMyAdmin Server: 192.168.1.188
DB Host 2 server: 192.168.1.245

Note: If you are a SUDO user then prefix every command with sudo, like #sudo ifconfig

So Let’s start

Step 1. Configuration Changes.

Go to installation Directory of phpMyAdmin and make the following change,  In your case, this directory location may be different.

Now add the following entries at the end of the file.

Step 2: Allow phpMyAdmin in DB Host 2 sever

Now Login into DB Host 2 and run the following command in MySql terminal to allow phpMyAdmin server to access DB Host 2.

Here you should create your desired user with your defined password with your desired privileges. You can also manage their privileges. This step is a security measure because we don’t want anyone to log in with root user into MySQL Server.

Step 3: Check Your Work 🙂

After this, as we have updated our configuration now we can access our phpMyAdmin in the web browser.

Step 4: Check Host List

Finally, you will see a drop down menu right beneath password text box. So now choose your host and type in your credentials which you created for DB Host 2.

If you can see below picture then your installation is successful.


Kapendra
Love to write technical stuff with personal experience as I am working as a Sr. Linux Admin. and every day is a learning day and Trust me being tech geek is really cool.
http://kapendra.com

Leave a Reply