Sunday, September 2, 2018

How do you troubleshoot if you are not able to connect to a database

In Amazon RDS, following could be the reason why you might not be able to connect:

1. Your instance is still booting up and getting ready. It takes about 20 minutes to do so.

2. use the command "netstat -an | grep 3306" on the ec2 instance. if the status is syn_sent, then check for firewall rules on the instance or the security group

2.if you are trying to access rds instance from the internet, then ensure that it is created in public subnet

3. Incorrect authentication. From the instance, try accessing with wrong username and pasword,
it will say access denied for user.

4. DNS is not able to resolve the endpoint: it will say unknown mysql server host
ensure that the endpoint is correct, else check your dns. you can use the tools like nslookup or netconnect, nc.
nc -zv ipaddress port -> name or service not known
you can also use telnet to see if it is listening on that port or not

5. check to see if the rds db instance is healthy
number of connections
amount of cpu used or memory used

1 comment:

My GutHub basics and cheat sheat

used for Source control management (SCM). Following are the few things you need to know: 1. cloning - pulling down the copy of the sour...