Accessing remote MySql server using local PhpMyAdmin

How to access remote MySql server using local PhpMyAdmin

It is very tedious to connect your remote mysql box especially when you are working with VPN. Initially I used telnet to connect to mysql box than I try to use workbench. Workbench is good and better than using telnet but again it consume more memory and if VPN got disconnected it just hanged. It so irritating. Than I try to configure my PHPMyAdmin to access remote mysql server and it is really very easy to setup. Just you need to configure/modify a single file in PHPMyAdmin folder i.e. “ config.inc.php”.

Just add below lines to your “config.inc.php” file add the bottom:

//provide hostname and port if other than default$i++; $cfg['Servers'][$i]['host'] = 'HostName:port';
//user name for your remote server
$cfg['Servers'][$i]['user'] = 'userName';
$cfg['Servers'][$i]['password'] = 'Password'; //password $cfg['Servers'][$i]['auth_type'] = 'config'; // keep it as config

If your mysql server is in remote than make sure that you are very much connected to box and than try to access PHPMyAdmin using url. You will get “Current Server” drop down with both “127.0.0.1” and one what you have provided with “$cfg[‘Servers’][$i][‘host’]”. You can switch between the servers by selecting the server “Current server” dropdown.

My PHPMyAdmin version: 4.0.4.1

My MySql Version: 5.5

Originally published at http://sforsuresh.in.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store