5

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?

Wtower
  • 18,848
  • 11
  • 103
  • 80
Bushinos
  • 53
  • 1
  • 1
  • 3
  • Welcome to Stack Overflow! I edited your question to format the error message as a blockquote so that it renders properly and is more readable - please see the editing help for more information on formatting. Please edit in to provide more detail that's necessary to identify the specific problem. Good luck! – Wtower May 08 '16 at 06:44

3 Answers3

17

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.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
aCiD
  • 1,273
  • 1
  • 18
  • 28
2

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

Anse
  • 1,573
  • 12
  • 27
  • Just in case anyone stumbles across this and the Arcus Global link above, I had to use the instance Public IPv4 address under the SSH tunnel tab -> SSH input field in order to connect. (the aws endpoint wasn't working for ssh purposes) – JoshieWahWah Oct 21 '22 at 20:38
  • Note that newer HeidiSQL versions have a separate network type "MySQL on RDS", which can be used either with or without SSH tunnel. – Anse Feb 27 '23 at 07:37
0

This detailed instructions worked for me: Connect To Amazon RDS (Or Any Database) Using HeidiSQL Via SSH Tunneling

Amr
  • 4,809
  • 6
  • 46
  • 60