Since I’m running my own Server, I also am in charge of my own Databases and their Backups. For the longest time I#ve been doing all the Database work via SSH and the Terminal on my Mac, well even though that works quite well if you know your way around MySQL and the Command Line, it gets kind of annoying and impractical if you are starting to use a couple different Databases and maybe once in a while want to check on your other users on your Server, too.
What first comes to mind administering DB is PHPMyAdmin, which is the all powerful and great MySQL Server administration tool, but oh well I don’t like it. I don’t like the UI, and it always felt “flaky” to me, even though its supposed to be perfectly stable from what I hear. So I stuck with the Terminal, until I figured that I could use my favorite MySQL tool on the Mac Sequel Pro and use it via an SSH Tunnel on my Remote Server.
To set this up you first need SSHKeychain (or use the Terminal to dig the Tunnel), and of course Sequel Pro. Now to setup the Tunnel.
- Got to SSHKeychains Preferences, and set up a Tunnel Forwarding the Local Port (ie 3307) you want to the MySQL Port (3306 by default), you also need to enter your Server Data unter SSH.
- Now Configure Sequel Pro to access your Database via this Portforward, thats easy just enter 127.0.0.1 as the Host (or use localhost), enter your User for the Server, Password, and finally the Forwarded Port (ie 3307)
Thats all, now you can connect and have access to your Databases via a nice Interface, and a Secure Connection via SSH.