Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HeidiSQL can't connect to my RDS database?

Hoping someone can help me with this issue I am running into. HeidiSQL won't connect to my RDS database. I can connect to it when I'm on my EC2 instance but not using Heidi SQL. The error I keep getting is:

Can't connect to MySQL server on 'localhost' (10061).

Anyone know how to get HeidiSQL to work with RDS on AWS?

like image 955
Bushinos Avatar asked May 08 '16 01:05

Bushinos


2 Answers

Here is how I did it using MySQL(TCP/IP option)

  1. On Amazon RDS, set RDS instance to be publicly accessible. Go to Details -> Modify -> Network & Security -> Public accessibility -> Yes

  2. Modify Security Group to allow access to your IP.

    RDS Instance page -> Connect -> Security group rules -> Select Security Group -> Inbound ->Edit -> Add Rule -> Type = MYSQL/Aurora -> Protocol = TCP -> Port range =3306 -> Source = My IP -> Save

  3. On HeidiSql,

    New Session -> 
    
     Setting tab ->
    
        Network Type = MySQL (TCP/IP)
           Hostname/IP = your RDS instance endpoint
           User = RDS instance username
           Password = your password
           Port = 3306
           Compressed client/server protocol = yest
           Databases = your database name
    

    Hit Open

Instructions used from Connecting to a DB Instance Running the MySQL Database Engine

HeidiSQL has issues connecting via SSL using the certificate issued by AWS. I used Eclipse and its plugins for SSL connection.

like image 91
aCiD Avatar answered Oct 12 '22 00:10

aCiD


If I understand right, RDS just needs an SSH tunnel before connecting per HeidiSQL to its MySQL server. Setting up a SSH tunnelled connection in HeidiSQL is easy, and documented in the help section.

There are also examples on how to connect especially to Amazon RDS via HeidiSQL, for example: http://www.arcusglobal.com/news/accessing-rds-using-heidisql

like image 45
Anse Avatar answered Oct 12 '22 00:10

Anse