Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have set up a WordPress website on a Ubuntu 12.04 Amazon ec2 machine by following this tutorial except the fact that I haven't created a MySQL database and I am using an amazon RDS MySQL service.

Everything works fine and I am able to create a configuration file during installation but when the installer asks for MySQL credentials. When I fill in the RDS credentials they don't work. I even tried entering the credentials manually in the wp-confiq file and still it said it couldn't connect to the database .

I tried to test out the same credentials on another WordPress installation in a shared hosting environment and the result was the same.

Then on the ec2 WordPress server I installed MySQL and then provided the MySQL details during installation and everything worked fine hence proving its something to do with RDS only.

Additional Details:

  1. The DB security Group has only one security: the EC2 Security Group

  2. Both EC2 and RDS are located in AWS singapore southeast-1a regions

  3. EC2 Security: only port 22 (ssh) and 80 (http) opened

share|improve this question
1  
Can you paste the output of the following command: telnet <end-point> 3306 from your EC2 instance. –  GeekRide Dec 22 '12 at 10:47
1  
Also, result for this command from your ec2 instance .. # host <mysql_end_point> –  GeekRide Dec 22 '12 at 11:48
    
i was using AWS singapore region and due to some internal network problems i couldnt connect to RDS and even on using the correct key pair i was not getting permission to log into ec2 instance . As a result i couldnt use your requested commands (Sorry About That) So i tried using the AWS Virginia region and everything went great . I followed exact same steps as i did in singapre region so i sum it up to be a internal network problem within AWS singapore and hence you should avoid AWS singapore for now. –  Danny Dec 22 '12 at 12:39
add comment

2 Answers

up vote 1 down vote accepted

Check that you can connect to the instance with the command line. See instructions here:

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToInstance.html

Maybe you have a problem with the credentials or with the network. Once you find the root cause it is easier to solve it.

share|improve this answer
    
i was using AWS singapore region and due to some internal network problems i couldnt connect to RDS and even on using the correct key pair i was not getting permission to log into ec2 instance . So i tried using the AWS Virginia region and everything went great . I followed exact same steps as i did in singapre region so i sum it up to be a internal network problem within AWS singapore. Thank You for your Answer! –  Danny Dec 22 '12 at 12:38
add comment

Here is a shot in the dark. When you see your endpoint it will resolve to a different IP if you do it on your home/work DNS resolver as apposed to an AWS resolver. AWS will give you back a private IP which is valid to connect to.

So I'm thinking you are using custom nameserver's in /etc/resolv.conf and not amazon's. So you are getting back the public IP on your instance and it can't go out and back in the NAT.

share|improve this answer
    
Thank You for the response but i am not that good in linux so most of what you said got over my head . Can you please elaborate it a little in noob language? Are you saying that changing to amazon nameservers in resolv.conf can be the solution? P.S. with the help of google search related to your answer i could figure out that rds problem that i am facing can be because of some dns settings in resolv.conf but other than that i dont know what to change and how to change it –  Danny Dec 22 '12 at 6:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.