I found most of the answers in this question lack explanation. To add RDS server in phpMyAdmin installed in EC2, you can first login to your EC2 via SSH. Then, issue the following command to edit the Config file of phpMyAdmin (use vi
, nano
or any other favorite text editing tool):
sudo vi /etc/phpMyAdmin/config.inc.php # Amazon Linux
sudo vi /etc/phpmyadmin/config.inc.php # Ubuntu Linux
Find the following lines in config.inc.php
:
/*
* End of servers configuration
*/
Append the following lines above the "End of servers configuration" line:
$i++;
$cfg['Servers'][$i]['host'] = 'xxxxx.xxxxxxxxxx.us-east-1.rds.amazonaws.com';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['verbose'] = 'YOUR_SERVER_NAME';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['compress'] = TRUE;
which YOUR_SERVER_NAME
is the name being displayed in phpMyAdmin login page's selection box. If you remove this line, the whole RDS hostname will be displayed in the selection box (which is too long, obviously). Remember to save the config.inc.php
.
There are several other config settings, which you can find the details in the official documentation.
Note: The other answer suggests auto login with preset username & password in Config file:
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = '__FILL_IN_DETAILS__';
$cfg['Servers'][$i]['password'] = '__FILL_IN_DETAILS__';
which is extremely dangerous if your phpMyAdmin is exposed to public. You don't want to show your database schema to everyone, do you? If you really want to use automatic login, make sure your phpMyAdmin is accessible via specific IPs only.
The problem is having wrong mod on the file.
Easily solved by executing -
chmod 400 mykey.pem
Taken from Amazon's instructions -
Your key file must not be publicly viewable for SSH to work. Use this
command if needed: chmod 400 mykey.pem
400 protects it by making it read only and only for the owner.
Best Answer
There is no other way but connecting to your instance and using any tool you might want to use to do the job - backup
This question was answered before.
download RDS snapshot