By using AWS re:Post, you agree to the Terms of Use

[Glue] Fail to connect to MySql running on EC2


I am trying to connect to MySql which is running on EC2 instance in VPC. However, I got the following error message and could not crawl tables.
ERROR : Could not find S3 endpoint or NAT gateway for subnetId: subnet-xxxx in Vpc vpc-xxxxx

I already created security group for Glue ( and attach it to EC2 instance and glue.

So does anyone know how we can connect to MySql running on EC2? Is there any special settings I have to do for this problem?

I am guessing that there is network issues because AWS says that Glue supports MySql running on Amazon EC2.

Edited by: Masahiko on Dec 28, 2017 3:51 AM

asked 5 years ago42 views
3 Answers

Now I can connect to MySql which is running on EC2 instance.

What we did:

  1. replaced NAT instance with NAT gateway
  2. Set security group to EC2 instance
answered 5 years ago

Hello Masahiko,

Can you please help me how you were able to connect to MySQL running on EC2. I am having difficulty for the same.

here is what I have done so far -

  1. Launched Linux Public EC2.
  2. Launched Linux Private EC2. Created NAT Gateway.
  3. Connected private EC2 through Public EC2 and Installed MySQL Server on private EC2.
  4. Created Database Employee on MySQL Server.
  5. GRANT ALL PRIVILEGES ON Employee.* TO 'root'@'<Private EC2 IP>' IDENTIFIED BY '<password>';
  6. Inbound Security group attached to Private EC2 instance -
    All TCP TCP 0 - 65535 sg-<SG ID>
    MYSQL/Aurora TCP 3306
  7. JDBC URL while setting up connection from Glue to MySQL DB
    jdbc:mysql://ip-<ip address>.ec2.internal:3306/Employee

Error I am getting is - "Host 'ip-<ip address>.ec2.internal' is not allowed to connect to this MySQL server"

Can you please help?
Please let me know if I need to provide any more details about it.


answered 3 years ago

I am able to connect to MySQL DB installed on Private EC2 instance now. Performed everything from scratch right from dropping and recreating VPC and all steps I mentioned in earlier post. Able to crawl MySQL Tables into Glue Catalog DB now.


answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions