Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cant connect to mysql server on AWS RDS

I am new to AWS RDS. I have created RDS instance.But i dont know, how can i connect this DB. I tried like this

mysql -h awsinstanamehere.rds.amazonaws.com -P 3306 -u username -p

After i entered password and i am getting some error like this

ERROR 2003 (HY000): Can't connect to MySQL server on 'awsinstanamehere.rds.amazonaws.com' (110)

Need to set any security setting in AWS console?

Note: I want to import tables for that DB

Thanks

like image 426
Rajaraman Avatar asked Feb 01 '14 07:02

Rajaraman


People also ask

Why can't I connect to RDS?

Troubleshoot database level issuesBe sure that you're using the correct user name and password to access the instance from your DB client. Be sure that the user has the database permissions to connect to the DB instance. Check for any resource throttling in Amazon RDS, such as CPU or memory contention.

Can't connect to the server MySQL?

normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket file name or TCP/IP port number when trying to connect to the server. You should also check that the TCP/IP port you are using has not been blocked by a firewall or port blocking service.


2 Answers

Same error, but in my case the problem wasn't related to security groups.
I forgot to add an additional route to the route table of the subnets.

See below the 2nd route where the internet gateway was added as the target for all non local traffic (outside the VPC):

enter image description here

like image 146
RtmY Avatar answered Sep 18 '22 18:09

RtmY


RDS has a security group - in the AWS console, RDS, there's an entry for security groups.

If you didn't explicitly create a security group, you are probably using "default". You should probably have one group per RDS instance.

You will need to make sure that port 3306 is open to your local network, as well as whatever application you will be using to connect to it. You can allow access by IP or by security group.

like image 40
chris Avatar answered Sep 21 '22 18:09

chris