Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Linux/Check DB Connection on AWS

December 3, 2017

Check DB Connection on AWS

When setting up your cloud infrastructure, you can check if your instances have access to the database by performing this command.

$ nc -zv 10.0.0.45 3306
$ nc -zv domain.com 3306
$ nc -zv endpoint.amazonaws.com 3306

$ nc -zv 10.0.0.45 3306 $ nc -zv domain.com 3306 $ nc -zv endpoint.amazonaws.com 3306

If connection has succeeded, you’ll get a message like this in Linux and MacOS …

Connection to endpoint.amazonaws.com 3306 port [tcp/mysql] succeeded!

Connection to endpoint.amazonaws.com 3306 port [tcp/mysql] succeeded!

On Windows, you can use Telnet to test your DB connection.

C:\>telnet endpoint.amazonaws.com 3306

C:\>telnet endpoint.amazonaws.com 3306

If connection has succeeded, the result is “no message.” If there’s a problem, you’ll get this ….

Connecting To endpoint.amazonaws.com...Could not open 
connection to the host, on port 3306: Connect failed

Connecting To endpoint.amazonaws.com...Could not open connection to the host, on port 3306: Connect failed

Filed Under: Linux Tagged With: connection, database, test

Content delivered to your email

About Me

I'm Ulysses, a Cloud Engineer at Cardinal Health based in Columbus, Ohio. I’m a certified AWS Solutions Architect. This website is my way of documenting the things I have learned in the Cloud. When off the grid, I enjoy riding my electric skateboard. I have surfed, snowboarded and played the saxophone in the past. I hope you will find this site helpful. It's powered by WordPress and hosted in AWS LightSail.

  • Cloud
  • Linux
  • Git

Copyright © 2012–2021