0

These are the steps I performed to set up mySQL server on my own desktop.

  1. Installed Cygwin
  2. Installed openssh. Then ssh-host-config ...
  3. Then I created a new connection established via "Standard TCP/IP over ssh".
  4. Tested the connection. And it worked fine.
  5. Open Connection and grant access to MacUser ...

Now I move to my Mac Laptop. And I want to be able to connect remotely using my MacOS laptop to the mySQL server resided in my desktop.

So i typed in the SSH Hostname and SSH Username and the password as well as the id_rsa.pub file. Then i tested the connection and got the following error messages.

    Could not connect the SSH Tunnel. 
    Authentication error. Please check that your username and password are correct and try again.
    Details (Original exception message):
    Authentication failed, please check credentials.
    Please refer to logs for details

Question : I am confident that my SSH Hostname and SSH Username and password are correct. My only concern is how would the mySQL server on my desktop recognize and approve the SSH key id_rsa.pub on my Mac ? Am I suppose to impose some rules in the ssh config files on my desktop first?

Please forgive me if this is a naive question but this is my first time playing around with ssh.

UPDATE:

I have attached the error logs below.

15:50:12 [INF][     SSH tunnel]: Existing SSH tunnel not found, opening new one
15:50:12 [INF][     SSH tunnel]: Opening SSH tunnel to <ip>:22
15:50:12 [ERR][sshtunnel.py:notify_exception_error:234]: Traceback (most recent call last):
  File "/Applications/MySQLWorkbench.app/Contents/Resources/sshtunnel.py", line 302, in _connect_ssh
    look_for_keys=has_key, allow_agent=has_key)
  File "/Applications/MySQLWorkbench.app/Contents/Resources/libraries/paramiko/client.py", line 367, in connect
    look_for_keys, gss_auth, gss_kex, gss_deleg_creds, gss_host)
  File "/Applications/MySQLWorkbench.app/Contents/Resources/libraries/paramiko/client.py", line 584, in _auth
    raise saved_exception
AuthenticationException: Authentication failed.

15:50:13 [ERR][     SSH tunnel]: Authentication error opening SSH tunnel: Authentication error. Please check that your username and password are correct and try again.
Details (Original exception message):
Authentication failed, please check credentials.
Please refer to logs for details
5
  • So what does the log tell you? Why didn't you just install the windows version of the server on the machine? – Seth Nov 11 '16 at 7:19
  • I do not know where to find and open the log. – mynameisJEFF Nov 11 '16 at 7:20
  • What program did you use to connect from your Mac to the PC? You probably would have two logs. One for the application on your Mac and one on the PC. I'm not certain where Cygwin stores its logs. Open it and try accessing /var/log and have a look. – Seth Nov 11 '16 at 7:29
  • I used mysql workbench. On my mac, i only have the /var/log directory which contains many files. Which one should i open? – mynameisJEFF Nov 11 '16 at 7:34
  • The one which is related to your MySQL Workbench installation. To find it have a look at the manual – Seth Nov 11 '16 at 7:40
0

As MySQL doesn't support public key authentication by default you won't be able to get it to accept your key.

What you're actually trying to do is access the openssh server you installed on a Cygwin installation on a Windows host and than MySQL Workbench is using that connection to reach the MySQL Server. This means that the MySQL Hostname would still be local host.

So in order to fix this you should try to establish a manual ssh connection to the PC running Cygwin.

If you want to use public key encryption for this make sure you set it up correctly which probably would involve generating a key-pair on your Mac and transferring the public portion of it to the PC. There is a number of tutorials available how to set this up properly. As you're not using a normal Linux you might have to watch out for Cygwin specifics.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.