Skip directly to content

Configure a local phpMyAdmin to access a remote server

 
on Tue, 11/29/2011 - 23:02

It's always nice to have just your local instance of phpMyAdmin be able to hit remote databases (if they are configured to allow remote access)

So, how do we get them to show up on your local copy?

I'm on a Mac, using MAMP.

The configuration file, in my case, is /Applications/MAMP/bin/phpMyAdmin/config.inc.php

 

Find the section marked 'Server Configuration'
add this underneath the first
$cfg

$i++;
$cfg['Servers'][$i]['host']          = '<remote-server-address>'; // MySQL hostname or IP address
$cfg['Servers'][$i]['port']          = '';          // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket']        = '';          // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type']  = 'tcp';       // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['extension']     = 'mysql';     // The php MySQL extension to use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress']      = FALSE;       // Use compressed protocol for the MySQL connection
$cfg['Servers'][$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user']              = 'db-username>';      // MySQL user
$cfg['Servers'][$i]['password']      = '<db-password>';          // MySQL password

 

Now there is a 'servers' dropdown on your phpMyAdmin front page. Pick your sever and bingo !

Tags: 

Post new comment