- LAMP Server configured with MySQL
- Incoming port (3306 by default) configured to allow connections
- Incoming port (3306 by default) configured within MySQL
- Database & User created
- in cPanel this id done on a per account basis from the MySQL Databases screen - Remote Access Hosts configured
- in cPanel this is done on a per account basis from the Remote Database Access Hosts screen
- if you do not have a specific IP address for the remote server that will be connecting, you can use %.%.%.% to represent all IP's
Once the above is completed you can use a local copy of phpMyAdmin to connect to the remote server. An example of the config.inc.php file would be:
/*
* First server
*/
$i++;
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'dbuser';
$cfg['Servers'][$i]['password'] = 'dbpass';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
If you receive an 2000 error "mysqlnd cannot connect to MySQL 4.1+ using old authentication" then you will need to follow the instructions found on this thread (http://stackoverflow.com/questions/1575807/cannot-connect-to-mysql-4-1-using-old-authentication)
- Login to server as root user
- Login to mysql as the user that you created for remote access
- # mysql -u dbuser -h localhost -p
- Once logged in as the remote user, change the password to a legacy format
SET SESSION old_passwords=FALSE;
SET PASSWORD = PASSWORD('dbpass');