SSH Tunneling for MySQL – user password trouble


#1

Hi folks,

Here’s another one…
So, in my continued effort to harden my WP installs, I am trying to “create” an ssh tunnel for use with Sequel Pro (GUI app) – I’m on a Mac. I followed the wiki and no matter what I do, when I use my DBusername@mysql.domain.com and Terminal asks for my password, it always rejects it. I have changed passwords a few times and tried them, just to make sure I hadn’t been using the wrong one… to no avail.

Does anyone have any other resources for ssh tunneling for mysql db’s? I am completely stuck on this one. Total novice when it comes to Terminal commands.

Thanks.


#2

Have you already whitelisted your IP for the database?


#3

You create a tunnel with your shell account credentials. You forward a port through the tunnel, then connect to the database with dbusername@localhost:forwarded_port

For example: ssh -Cv -L 3307:mysql.example.com:3306 user@example.com

then you connect to the DB on localhost:3307


#4

That’s what I must be doing wrong. I thought since the domain and db servers are separate that wouldn’t work.

So, another question – what is the SSH Host? localhost? Sorry about being thick!

Thanks for the help Bobocat! It all works great now!!
Really, really appreciate it!