Phptheadmin for RDS

amazon ec2amazon-rdsphpmyadmin

I decided to put an AWS related Q here after having asked on aws dev forum and did not find a solution.

I have also followed the steps given on a repeat question here

Can someone please tell me where I am making the wrong move.

My EC2 instance is in us-west-1c (linux) and has phpmyadmin installed in it.
My RDS is also in us-west-1c
My security grp common to EC2 and RDS has http/ssh/mysql ports configured.

I am able to connect to my rds from my instance using mysql_connect() in php,
but if I give my rds endpoint as a host in phpmyadmin (config.inc.php) it does not respond.

This is how my config.inc.php looks like

$cfg['Servers'][$i]['host'] = 'xx.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'] = true;

$cfg['Servers'][$i]['auth_type'] = 'config';

$cfg['Servers'][$i]['user'] = 'xxx';

$cfg['Servers'][$i]['password'] = 'xxx';

Am I missing something here ?

thank you very much in advance

Best Answer

You have to allow outside connections in the httpd conf:

sudo nano /etc/httpd/conf.d/phpmyadmin.conf

Update it to:

<Directory "/usr/share/phpmyadmin">
  Order Deny,Allow
  Allow from all
</Directory>

Then restart apache

sudo service httpd restart

You only need to update the following in the phpmyadmin/config

sudo nano /usr/share/phpmyadmin/config.inc.php

$cfg['blowfish_secret'] = 'somerandomtext';
$cfg['Servers'][$i]['host'] = 'xxx-your-service-host.rds.amazonaws.com';

Hope this helps.

Related Topic