connect mysql server installed on t1.micro instance from vpc t2.micro instance

Fatimah Wulandari asked:

I have mysql database server installed on ubuntu in t1.micro ec2 :

Instance state: running
Public IP:
Instance type: m1.medium
Elastic IP:
Private DNS:
Availability zone: us-west-1a

I create another instance, this one using t2.micro so it’s using vpc

Instance type: t2.micro
Elastic IP:
Private DNS:
Availability zone: us-west-1a
Private IPs:
Security groups: default. view rules
Secondary private IPs: Scheduled events
No scheduled events
VPC ID: vpc-25xxxxxx
AMI ID: ubuntu-trusty-14.04-amd64-server-20150325 (ami-xxxxxxxx)
Subnet ID: subnet-9cxxxxxx

I’m deploying website in t2.micro and want to access mysql server in t1.micro. I’ve edited my.cnf configuration to comment #bind_address. In the t1.micro security group I’ve tried to add new inbound rule to access mysqlserver :

type : mysql
protocol : tcp
port : 3306
source : private ip of my t2.micro instance

My website could not access the server.

My answer:

You will need to set up ClassicLink to allow your classic EC2 instance to communicate with your new instance in the VPC.

This has two steps:

  1. Edit the VPC to enable ClassicLink. Click your VPC in the list of VPCs, select Actions, then Enable ClassicLink.

  2. Attach the classic instance to the VPC. Click your old instance in the list of instances, select Actions, ClassicLink, Link to VPC.

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.