arrayZero
arrayZero

Reputation: 392

mysql could not connect the SSH tunnel -> access denied for 'none'

I have a server which I can only access via SSH, I have installed MySQL on this server. And created a remote user so I could develop using mySQL workbench, but when try to SSH using MySQL workbench GUI I get the following error: Could not connect the SSH tunnel Authentication that can continue public key.

I'm able to connect to the user from the server itself and that works without any problems, I've checked the privileges and remote access seems to be activated for this user:

+------------------+-----------+
| user             | host      |
+------------------+-----------+
| developer        | %         |
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+

I've filled in the following:

SSH Hostname <server-IP>
SSH username root
SSH password <clear>
SSH Key File <privat key file>

MySQL Hostname 127.0.0.1
MySQL Server Port 3306
Username <user>
Password <password>
Default Schema <empty>

Upvotes: 28

Views: 59207

Answers (11)

J4102
J4102

Reputation: 473

This is apparently a known bug that has been ongoing the past few years:

Access denied for 'none'. Trying to access a MySQL Workbench database via SSH using RStudio

In order to connect, you should either use an RSA key with a passphrase or an ed25519 without one

Upvotes: 0

Jiri K
Jiri K

Reputation: 55

The issue I faced, where I received the error message "Access denied for 'none'. Authentication that can continue: publickey,password" during SSH connection, was due to not having my public key in the ~/.ssh/authorized_keys file on the server. Adding the public key to this file resolved the problem in my situation.

Upvotes: 0

SherylHohman
SherylHohman

Reputation: 17880

My case was strange. I had been successfully making the connection for years.
It seems they changed the format for (new) master password to the server my website & database are on.
While my password still worked for connecting via FTP, MySQL Workbench could not connect to the database. Oddly once I clicked to "edit" the master password on my server, I saw that the current password did not match their new password requirements.
Updating the master server password (everywhere) fixed the issue. Password for MySQL did not need to change.
Turns out that I was not even using a putty generated key for this particular connection, despite the message. I found it strange that the password worked everywhere, except for connecting to the database via Workbench. Had it worked nowhere, I probably would have tried resetting the password earlier, and was dumbfounded as to why the technically correct, working everywhere else, password wouldn't work (stopped working) with Workbench.
Anyway, this is at lease a note to myself in case I ever run across a similar strangeness again.

Upvotes: 0

Minux
Minux

Reputation: 49

May be it is caused by the version. For example, if you use workbench 5.7 to connect the remote mysql server 5.1, than the connection can not be build. However, if you use command line, mysql -uroot -proot -h remote_mysql_ip, it worked. Then, you can use the IDE datagrip from jet brains. It will hint you the version issue, and you should download the mysql-5.1 jdbc connection jar file for connection.

Upvotes: -1

Elijah Waters
Elijah Waters

Reputation: 1

For me, this had to do with user:group. Instead of having the file as root:root, I did a chown to localuser:localuser and it worked fine.

Upvotes: 0

kuhajeyan
kuhajeyan

Reputation: 11017

For my case using with mysql workbench 8.0 required new openssh key format. so when you generate openssh format. Make sure you generate new format and then provide that key for sshkey

Upvotes: 1

Dario Fumagalli
Dario Fumagalli

Reputation: 1254

For those who, like me, were trying to connect through a SSH key generated by PuTTY:

  1. Open the private key with PuTTYGen. It'll ask for the private key password.
  2. Go to Conversions->Export OpenSSH Key menu.
  3. It'll ask for the file name to assign to the converted OpenSSH key. Give it a different name than the PuTTY private key one you started with.
  4. In MySQL Workbench use the converted key as "SSH Key File". When asked, enter the private key password.
  5. At this point it should connect.

Upvotes: 36

Rinze Smits
Rinze Smits

Reputation: 868

I had to remove the passphrase from my key file to allow MySQL Workbench to use it.

Upvotes: -3

Vladimir Ch
Vladimir Ch

Reputation: 547

in my case, there was a problem when i select id_rsa.pub instead id_rsa, so when i select id_rsa problem dissaper!

Upvotes: 6

Adam Kiraly
Adam Kiraly

Reputation: 91

For me it was actually vice versa - my key was an RSA private key, and had to convert it to OpenSSH. Then MySQL Workbench connected successfully. I guess whoever has a similar problem it may be wort to try to convert the private key either way.

Upvotes: 9

Danbardo
Danbardo

Reputation: 859

I had a similar issue connecting to MySQL and wanted to share my solution in case anyone else ends up here.

The issue occurred in two different scenarios.

Scenario one: I gained access to the MySQL database successfully using a private key generated by my server (I am using CPanel). I deleted the corresponding public key (mistakenly) from my server then tried to re-connect and received the error.

The solution here of course was to regenerate the keys.

Scenario two: I try to access the MySQL database using an OpenSSH generated private key. I set the location of the key to C:/Users/username/.ssh/id_rsa and received the error.

The solution here was to convert the OpenSSH private key to an RSA private key.

ssh-keygen -p -m PEM -f C:/Users/username/.ssh/id_rsa

Make sure you backup your OpenSSH private key beforehand as this will override id_rsa.

I was then able to connect to the MySQL server using the RSA private key.

You can distinguish between the two types of keys by viewing them in any text editor and reading the first line. It will say either OPENSSH or RSA.

Upvotes: 51

Related Questions