DBeaver SSH connect with DigitalOcean/MySql

Posted February 10, 2017 18.1k views
MySQLDigitalOceanUbuntu 16.04

After trying every solution that I could find, nothing worked. So I’m posting my question here.

Followed instructions on how to connect but always getting same error

Can't initialize tunnel
  Cannot establish tunnel
    com.jcraft.jsch.JSchException: Auth fail

My connection settings:
Server Host:
Port: 3306
Username: database username
Password: database password

Host/IP: myIPaddress
Port: 22
User Name: hostname
Authentification Method: Public Key
Private Key: ……ssh\id_rsa

What am I doing wrong here?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
4 answers

So, that was stupid of me.

It should be my IP address insted of

Now it works like a charm.


By default, MySQL doesn’t allow remote connections as it’s bound to localhost or

You’d need to modify MySQL’s configuration from the CLI and find:

bind-address            =

and comment it out, so that it looks like:

#bind-address            =

and then restart MySQL. If you’re using MariaDB instead of the actual MySQL package, you’d need to modify this file:


otherwise the file should be:


As for the connection settings, are you using your hostname as the username? Your username should be either root or your sudo user (if you’ve set one up) for the non-database login.

bind-address is my IP address, tried comment it out, still not working.

Can’t find 50-server.cnf
just /etc/mysql/mysql.conf.d/mysqld.cnf

Not quite sure what I need to modify in here?

I’m using hostname for network connection (SSH Tunnel), for connection setting username.

On command I’m getting telnet myipaddress 22

Trying myipaddress ...
Connected to myipaddress.
Escape character is '^]'.
SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
Connection closed by foreign host.

Does that have somenting to do with not connesting?

And now I’m getting

Communications link failure

The last packet sent successfully to the server was 0 miliseconds ago. The driver has not received any packets from server.