Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im in a bit of a bind here. I have a client that want's me to set up his website, but he runs the server w/ SSH and CentOS 6.2 as it's OS.

Now, I'm trying to add the sql server on Mysql Workbench for easy handling, but I cant connect to Mysql. The SSH connection works fine, and I get privileges with sudo, so to speak.

The server guy said (and I use PuTTY by the way ): Open a tunnel on port 3306 (source) to dest: which is the mysql port.

I have the user as "root" and have tried with the password I use to log on to my local sql (phpmyadmin) as root, and I've tried with no password.

He also mentioned that the mysql server only responds to loopback.

After this I havent gotten a hold of him, and have very limited time. If you have pointers / suggestions or help I'd be very glad.

Thank you.

Edit: After countless hours of failure, I noticed I had used the wrong username for the Mysql connection inside Workbench. I used the same as my SSH login, which was wrong in my case. I had to use my dedicated Mysql username (obviously).

Thanks for the help, anyways!

share|improve this question

With PuTTY, configure the tunnel info as provided by the server guy (Connection -> SSH -> Tunnels). But use whatever hostname and user/password that you would for a "regular" SSH connection, which you say works fine.

You don't need a root SSH login to the CentOS server, just your own SSH login. The tunnel lets Mysql Workbench talk to MySQL as if it were running on your own local machine.

... or are you saying that you have the SSH tunnel established, but you cannot login successfully to MySQL?

share|improve this answer
That was indeed the problem, yes. But I managed to make the connection because silly me user the wrong username on the Mysql connection. I used the same I did to establish the SSH connection, but I had a different username for the Mysql connection. – Oyvind Andersson Jun 19 '12 at 9:02
But the problem I had first off, was fixed with your solution (using proper tunnel), so the answer given here is correct in a sense. Thanks – Oyvind Andersson Jun 19 '12 at 9:05
up vote 0 down vote accepted

I used my SSH login for the Mysql connection in workbench, which in my case was an error, as I had a dedicated Mysql login username and password. I also had to specify the scheme I was logging in to.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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