Friday, June 27, 2014

How to Add Multiple Hosts in phpMyAdmin

This how to guide will help you to add multiple database hosts in phpMyAdmin, So we can select to which database server we need to connect.
After installing phpMyAdmin on your Linux/Windows systems, lets use this to manage multiple hosts from one phpMyAdmin install.
To add multiple hosts, first edit phpMyAdmin configuration file and add following entries at the end of file.
 # cd /usr/share/phpMyAdmin
 # vim config.inc.php
Now add the following entries at the end of file.
 $i++;
 $cfg['Servers'][$i]['verbose'] = 'Database Server 2';
 $cfg['Servers'][$i]['host'] = '192.168.1.102';
 $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';
 $cfg['Servers'][$i]['AllowNoPassword'] = false;
After adding the above entries in configuration file and access phpMyAdmin in web browser and you will get an option of server choice. Select server name to which you need to connect.
phpmyadmin-multiplehosts

0 comments: