Reputation: 5792
I have phpmyadmin
installed in this location /usr/share/phpmyadmin
. Database is running on localhost. So, I can access database from phpmyadmin without any changes. I want to change localhost to different host or add additional host.
For this, I tried to change config.inc.php
file and add below code:
$i++;
$cfg['Servers'][$i]['host'] = 'xxx-east-1.rds.amazonaws.com';
$cfg['Servers'][$i]['port'] = '3306';
$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';
$cfg['Servers'][$i]['user'] = 'xxx';
$cfg['Servers'][$i]['password'] = 'xxx';
But, It's not connecting with that host. Where should I change this information?
One strange thing I noticed is when I removed config.inc.php
, still phpmyadmin
was working. But, may be its because of localhost default settings.
Upvotes: 0
Views: 12746
Reputation: 94642
Assuming this is your original localhost settings in phpMyAdmin
$i++;
$cfg['Servers'][$i]['verbose'] = 'MySQL localhost';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = 3306;
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';
All you do is add another block to setup another selectable connection
$i++;
$cfg['Servers'][$i]['verbose'] = 'MySQL on Amazon';
$cfg['Servers'][$i]['host'] = 'xxx-east-1.rds.amazonaws.com';
$cfg['Servers'][$i]['port'] = 3306;
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';
But you should check that your remote Amazon MySQLServer is using port 3306 as standard, and that there is a user account setup that is allowed to connect from a remote location.
And of course restart Apache after making this change.
Upvotes: 1