Question

DBeaver SSH connect with DigitalOcean/MySql

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: 127.0.0.1 Port: 3306 Username: database username Password: database password

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

What am I doing wrong here?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Accepted Answer

So, that was stupid of me.

It should be my IP address insted of 127.0.0.1.

Now it works like a charm.

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.

@verse

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

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

bind-address            = 127.0.0.1

and comment it out, so that it looks like:

#bind-address            = 127.0.0.1

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

/etc/mysql/mariadb.conf.d/50-server.cnf

otherwise the file should be:

/etc/mysql/mysql.conf.d/50-server.cnf

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.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.