PHPMyAdmin is a very popular software to manage MySQL databases and tables. By default, phpmyadmin connects to the database which is present in the same host. The configurations defaults to localhost.
Inorder to connect to a remote database like AWS RDS, we need to make few configuration changes. I will explain the configuration changes below.
We need to make modifications in two config files.
The files are located in the following locations (Ubuntu OS) /etc/phpmyadmin/config-db.php /etc/phpmyadmin/config.inc.php
Modify the contents with the following parameters. Ensure these parameters are uncommented.
$cfg['Servers'][$i]['host'] = 'RDS MYSQL ENDPOINT';//Enter IP address or hostname $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['extension'] = 'mysqli'; // Extension to connect to mysql. $cfg['Servers'][$i]['port'] = ''; //The port number of MySQL service $cfg['Servers'][$i]['user'] = ''; // Username to connect $cfg['Servers'][$i]['password'] = ''; //Password associated with the username
Note: Ensure network connectivity is enabled from the machine where PHPMyAdmin is enabled to the AWS RDS instance. (Outbound from the machine and Inbound to AWS RDS instance)
Also sometimes, SELinux blocks the MySQL connectivity. Made adjustments in SELinux policies or turn off SELinux if you are facing any issues.
I hope this tip is helpful. Feel free to comment if you are facing any issues.