1
votes

I am currently having issues with phpMyAdmin connecting to the database on RDS.

My setup is a box (admin box) that is on an EC2 instance running CentOS x64. It has the latest releases of phpMyAdmin, Apache, MySQL and has all the required packages in order to run. A php test page shows that the MySQL plugins are installed and loaded.

On the console I can connect to my RDS server remotely using (logged in as root over SSH)

mysql -h XXXXX -uXXXXX -pXXXXX

I am able to execute statements and read the databases via command line. I can also connect via the MySQL workbench from my home computer and make the changes. So the security group seems to be defined properly. I have checked the config.ini.php file in the /etc/phpmyadmin/ directory, as well as adding one to the /usr/share/phpmyadmin section.

This wouldn't be an issue but I'm trying to make it available to myself and my client in order to facilitate ease of transfer should I be unable to continue supporting the client.

I can get to the console (I have edited the phpmyadmin.conf to allow my ip) and that loads up, but I still get a #2002 Cannot log in to the MySQL server whenever I log in using credentials that I know are correct.

My config.ini.php file is:

$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'XXXXX.rds.amazonaws.com';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['Servers'][$i]['ssl'] = false;

I have tried editing it any number of ways to get it to connect, always restart the apache server JUST in case. Yet, I still cannot connect.

1

1 Answers

3
votes

I have found the culprit. I didn't think to explicitly enable the webserver to connect and the selinux needed me to enter:

setsebool -P httpd_can_network_connect=1

for it to allow it to connect. The moment I enabled that, it was able to connect to the database and was able to be managed. Thank you for those who viewed and commented and hopefully this helps someone else in the future.