In this tutorial, we will learn how to connect AWS RDS MySQL server with phpMyAdmin.
Follow below steps to configure:
Step 1:
Install Apache Web Server
Step 2:
Install PHP
Follow below steps to configure:
Step 1:
Install Apache Web Server
sudo apt-get update -y
sudo apt-get install apache2 -y sudo systemctl start apache2.service |
Verify that Apache was installed without errors by accessing it from your local browser. Enter http://SERVER_IP/
Step 2:
Install PHP
sudo apt-get install php -y
sudo apt-get install -y php-{bcmath,bz2,intl,gd,mbstring,mcrypt,mysql,zip}
sudo apt-get install libapache2-mod-php -y
|
Step 3:
Restart Apache
Restart Apache
systemctl restart apache2.service
|
Step 4:
Install and configure phpMyAdmin
cd /var/www/html/
|
Download phpMyAdmin from an authorized website using wget command
wget https://files.phpmyadmin.net/phpMyAdmin/4.7.3/phpMyAdmin-4.7.3-all-languages.zip
|
Unzip phpMyAdmin
Rename phpMyAdmin and go to phpMyAdmin folder
unzip phpMyAdmin-4.7.3-all-languages.zip
|
mv phpMyAdmin-4.7.3-all-languages phpmyadmin
cd phpmyadmin |
Edit the configuration file for phpMyAdmin.
Below is a default file
Now, edit this file according to below file
Save file and Close.
You can get 'RDS MYSQL ENDPOINT' from AWS RDS console.
enter username and password of your RDS. and access it.
vim config.sample.inc.php
|
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
|
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'RDS MYSQL ENDPOINT';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
|
You can get 'RDS MYSQL ENDPOINT' from AWS RDS console.
Step 5:
Restart Apache
Restart Apache
systemctl restart apache2.service
|
Step 6:
Open inbound port 3306 in RDS Security group for access MySQL to phpMyAdmin. you can give which IP where phpMyAdmin is installed in Security group.
Step 7:
Access phpMyAdmin from your local browser. Enter http://SERVER_IP/phpMyAdmin Open inbound port 3306 in RDS Security group for access MySQL to phpMyAdmin. you can give which IP where phpMyAdmin is installed in Security group.
Step 7:
enter username and password of your RDS. and access it.