2
votes

I have created an MySQL RDS instance with VPC. Now i am trying to connect to that RDS instance from my Ubuntu 12.04 machine using MySQL client by following code:

mysql -u uname -h test.c6tjb4nxvlri.us-west-2.rds.amazonaws.com -P 3306 -p

But i am getting this error:

ERROR 2003 (HY000): Can't connect to MySQL server on 'test.c6tjb4nxvlri.us-west-2.rds.amazonaws.com' (110)

I searched about this error and everywhere solution came out like

  • Go to the Instances
  • Find the security group
  • Change the inbound rules of that security group by
  • Adding source of user machine public ip or
  • Set source ip as 0.0.0.0/16

enter image description here

I tried everything but still same error occures. Any explanations?

2
You can ping that instance?Tom Cammann
nope. nothing is there. it's just stuck after showing it's IPZahidul Islam Jamy
@TomCammann Amazon rds cannot be able to pingZahidul Islam Jamy

2 Answers

2
votes

The problem was in subnet. Subnet that you created must be publicly accessible.

0
votes
  1. In On-premises MySQL Workbench, use TCP/IP SSH Tunneling option. Make sure you have EC2 instance endpoint and keypair file.
  2. In SSH endpoint - add your EC2 instance endpoint and for SSH password, browse your keypair. Rest of configurations for MySQL. Like MySQL's endpoint, username, password, port and schema name.
  3. Test your connection it will return success. If not, check RDS Security group. In Security group, you open MySQL port for all IP address. Try it! it will work. Once connection was success, all schema are visible in MySQL Workbench.
  4. RDS DB instance need not to be in public subnet and it is not best practice to do. Always keep RDS DB instance in private subnet and open traffic for EC2 instance.

When you use TCP/IP SSH Tunneling, request traffic will send through EC2 instance to RDS DB instance.

HTH.