Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Nielson's avatar
Level 14

Connecting to Digital Ocean via SSH in Heidi SQL

Hi guys!

So i'm having some troubles connecting to my database via SSH in Heidi SQL. It worked flawlessly 2 weeks ago, but after I moved my private and public keys from one folder to another, it doesn't anymore. I did link to the new location of the private key in Heidi SQL, but still error. I created a new public and private key in Git Bash using the command "ssh-keygen -t rsa -C "[email protected]", added the rsa_id.pub key to Forge and then linked to the private key in Heidi SQL, but it gives me the following error:

"Plink exited unexpected. Command line was: C:\Users\Nielson.ssh\plink.exe -ssh forge@IPADDRESS -pw "*****" -P 22 -i "C:\Users\Nielson.ssh\id_rsa" -N -L 3307:IPADDRESS:3306"

I have searched far and wide, followed the tutorial on Laracast, but nothing helps me getting further.

Does anyone have a magic solution to this? :)

EDIT: If I follow the tutorial on Laracast on my Macbook Air, I have no problems connecting to the database through Sequel Pro.

0 likes
8 replies
jorenrapini's avatar

Hello, did you ever find a solution to this? I'm having this same problem, but only with specific droplets (used a different one-click-app setup). Other droplets don't have the issue.

Nielson's avatar
Nielson
OP
Best Answer
Level 14

Hi @jorenrapini !

I did find a solution, but as always, it's something that just comes to me after a lot of tries and then I completely forget what did the trick.

Honestly I forgot about this thread , but I will see if I can explain my method.

Just as a quick note to what my settings in Heidi SQL looks like because I was a bit vague on this point:

Settings

  • Network type: MySQL (SSH tunnel)
  • Hostname / IP: 127.0.0.1
  • User: #YOUR-USERNAME#
  • Password #YOUR-PASSWORD#

SSH Tunnel

  • plink.exe location: Self explanatory
  • SSH-Host + port: IP to your droplet + 22 (port)
  • Username: #YOUR-USERNAME#
  • Password:
  • Private key: Link to "private.key.ppk"
  • Localpost: 3307

The above settings did it for me when I created a keyfile in Puttygen and uploaded the public file to Forge.

I hope it works for you as well :)

3 likes
denislam's avatar

If a passphrase was prompted where would you enter it inside HeidiSQL? I see a dialog box but no input field to input the passphrase!

Nielson's avatar
Level 14

@denislam I'm pretty sure that the only passphrase you need to enter, is the password under the username field.

1 like
desther's avatar

@Nielson Thank you, i finally managed to sucessfully connect thanks to your info.

1 like
tinybot's avatar

Hi guys! Thought I would contribute to this - just spent a few hours racking my brain trying to figure out how to connect to MySQL on my DigitalOcean droplet, which was setup via Laravel Forge.

Specifically I kept running into the PLink exited unexpected. Command line was... error, which after some additional digging (and also by replicating the command via the command line), learned that this error message is actually triggered by a problem with the public key that I stored in the "SSH Keys" section in Laravel Forge.

Interestingly, I was able to connect far more easily with MySQL Workbench. But I prefer HeidiSQL, and the issue came down to this.

When adding your public key to the "SSH Keys" section in Laravel Forge, your key needs to look like this:

ssh-rsa AAAA...

ALSO - make sure to remove the carriage returns and put everything on to a single line before pasting to Forge.

So if you are using PuTTY to generate your key pairs, make sure to copy from the "Key" section in the PuTTY interface.

My mistake was just copying and pasting the entire contents of the public key file, which worked fine with Workbench (I guess it's more forgiving than the plink tool used with HeidiSQL). (Of course, you could manually manipulate the contents to match the format, too.)

Reference: https://askubuntu.com/questions/204400/ssh-public-key-no-supported-authentication-methods-available-server-sent-publ

1 like

Please or to participate in this conversation.