AWS Aurora MySQL serverless: how to connect from MySQL Workbench

Phong Vu picture Phong Vu · Aug 7, 2018 · Viewed 21.6k times · Source

I was trying to use AWS Aurora Serverless for MySQL in my project, but I am impossible to connect to it, though I have the endpoint, username, password.

What I have done:

  1. From AWS console managment, I select RDS > Instances > Aurora > Serverless
  2. Leave the default settings
  3. Create database
  4. AWS will only create an AWS Cluster enter image description here
  5. I open MySQL Workbench, and use endpoint, username, password to connect the database

Ressult:

Your connection attempt failed for user 'admin' from your host to server at xxxxx.cluster-abcdefg1234.eu-west-1.rds.amazonaws.com:3306: Can't connect to MySQL server on 'xxxxx.cluster-abcdefg1234.eu-west-1.rds.amazonaws.com' (60)

Did I make any wrong steps ? Please advice me.

****EDIT****

I tried to create another Aurora database with capacity type: Provisioned. I can connect to the endpoint seamlessly with username and password by MySql workbench. It means that the port 3306 is opened for workbench.

About the security group: enter image description here

Answer

Yoga picture Yoga · Aug 21, 2018

From https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/aurora-serverless.html :

  • You can't give an Aurora Serverless DB cluster a public IP address.
  • You can access an Aurora Serverless DB cluster only from within a virtual private cloud (VPC) based on the Amazon VPC service.
  • You can't access an Aurora Serverless DB cluster's endpoint through an AWS VPN connection or an inter-region VPC peering connection. There are limitations in accessing a cluster's endpoint through an intra-region VPC peering connection; for more information, see Interface VPC Endpoints (AWS PrivateLink) in the Amazon VPC User Guide. However, you can access an Aurora Serverless cluster's endpoint through an AWS Direct Connect connection.

So, aside from SSH-ing through an EC2 instance, you can also access your serverless cluster with mySQL Workbench with AWS Direct Connect.