poupette
poupette

Reputation: 61

Connecting Securely to MySQL Database on an Amazon EC2 instance from another EC2 instance

I'd like to connect to a mysql database on an AWS EC2 instance from another EC2 instance, but I don't want this mysql database to be accessible from other IP addresses. Changing the bind-address in my.conf to 0.0.0.0 allows everybody to access it, and I don't feel comfortable doing this.

What's the best approach on AWS to configure this in a secure way?

Upvotes: 0

Views: 115

Answers (1)

Piyush Patil
Piyush Patil

Reputation: 14533

It is easy to do the above. Lets say EC2-1 is your instance and EC2-2 is your MYSQL instance with Security group 1 for EC2-1 and Security group 2 for EC2-2. Add below rule in your Security Group 2. So you can only connect to MYSQL running on EC2-2 from EC2-1 and no body else can connect.

enter image description here

Upvotes: 1

Related Questions