Saturday, August 3, 2013

Configuring PHPMYADMIN on Amazon EC2 to manage Amazon RDS MySQL

The installation procedure of PHPMYADMIN is very simple and there are numerous blogs available across internet which will help you to configure phpmyadmin.
Even, I followed same blogs/articles to configure phpmyadmin on Amazon EC2. But things didn’t clicked for me instantly. I figured out the solution for some of the problems and thought of writing a post on this.
There are two ways to configure phpmyadmin :
1. Download phpmyadmin package and install that.
2. Installing through repositories by enabling epel
I followed 2nd procedure.
Installation Steps :
1. To install phpmyadmin package :
# sudo yum --enablerepo=epel install phpmyadmin
2. Navigate to file "/etc/httpd/conf.d/phpMyAdmin.conf" and make sure you can access phpMyAdmin from outside (your local pc).
<Directory /usr/share/phpMyAdmin/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
#       Require ip
        Require ip <Add-your-IP>
       Require ip ::1
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
#     Allow from
        Allow from <Add-your-IP>
     Allow from ::1
3. Edit mysql host in file
In order to access RDS database, we need to modify mysql host in file. Most of the blogs across web points to /usr/share/phpMyAdmin folder and copying as But modifying mysql host in this file didn’t work for me.
In order to get that working, I had to modify in /etc/phpMyAdmin.
# sudo vi /etc/phpMyAdmin/
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['host'] = ''; //Your-RDS-Instance-Endpoint
4. Perform httpd restart
# sudo yum install httpd
5. Browse PHPMYADMIN on your browser
If you face below mentioned error :
#2002 - Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
The server is not responding (or the local server’s socket is not correctly configured).
Then most probably, you haven’t modified mysql host in present in/etc/phpMyAdmin. Modifying mysql host in present in/usr/share/phpMyAdmin may not work for you.

No comments:

Need Consulting help ?


Email *

Message *

All posts, comments, views expressed in this blog are my own and does not represent the positions or views of my past, present or future employers. The intention of this blog is to share my experience and views. Content is subject to change without any notice. While I would do my best to quote the original author or copyright owners wherever I reference them, if you find any of the content / images violating copyright, please let me know and I will act upon it immediately. Lastly, I encourage you to share the content of this blog in general with other online communities for non-commercial and educational purposes.