How to access remote server with local phpMyAdmin client?
Assuming there is a remote server and I have phpMyAdmin client installed localy on my computer. How can I access this server and manage it via phpMyAdmin client? Is that possible?
Solution 1:
Just add below lines to your /etc/phpmyadmin/config.inc.php
file in the bottom:
$i++;
$cfg['Servers'][$i]['host'] = 'HostName:port'; //provide hostname and port if other than default
$cfg['Servers'][$i]['user'] = 'userName'; //user name for your remote server
$cfg['Servers'][$i]['password'] = 'Password'; //password
$cfg['Servers'][$i]['auth_type'] = 'config'; // keep it as config
You will get Current Server:
drop down with both 127.0.0.1
and one what you have provided with $cfg['Servers'][$i]['host']
can switch between the servers.
More Details: http://sforsuresh.in/access-remote-mysql-server-using-local-phpmyadmin/
Solution 2:
It can be done, but you need to change the phpMyAdmin configuration, read this post: http://www.danielmois.com/article/Manage_remote_databases_from_localhost_with_phpMyAdmin
If for any reason the link dies, you can use the following steps:
- Find phpMyAdmin's configuration file, called
config.inc.php
- Find the
$cfg['Servers'][$i]['host']
variable, and set it to the IP or hostname of your remote server - Find the
$cfg['Servers'][$i]['port']
variable, and set it to the remote mysql port. Usually this is3306
- Find the
$cfg['Servers'][$i]['user']
and$cfg['Servers'][$i]['password']
variables and set these to your username and password for the remote server
Without proper server configuration, the connection may be slower than a local connection for example, it's would probably be slightly faster to use IP addresses instead of host names to avoid the server having to look up the IP address from the hostname.
In addition, remember that your remote database's username and password is stored in plain text when you connect like this, so you should take steps to ensure that no one can access this config file. Alternatively, you can leave the username and password variables empty to be prompted to enter them each time you log in, which is a lot more secure.