Thursday, May 27, 2010

Connect To MySQL Remotely From phpmyadmin

I have a XAMPP installed and wanted my phpmyadmin to connect to mysql database remotely.

So a google search threw up this link

Basically you have to edit the file: config.inc.php which is located in xampp/phpmyadmin

To add a new server you simply have to append the following lines:


<?php
$i++;
//add remote server hostname or ip
$cfg['Servers'][$i]['host'] = 'hostname or ip';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['compress'] = FALSE;
$cfg['Servers'][$i]['auth_type'] = 'config';
//add credentials
$cfg['Servers'][$i]['user'] = 'THE MYSQL USER NAME';
$cfg['Servers'][$i]['password'] = 'THE MYSQL USER PASSWORD';
view raw config.inc.php hosted with ❤ by GitHub