Managing your DigitalOcean MySQL databases with MySQL Workbench

I am trying out the excellent DigitalOcean to host this blog along with a few other personal projects. This is my first time using a dedicated VPS for hosting and while it provides me with a great deal of control over my resources, one obvious down side is that I am also directly responsible for all system administration work. Instead of trying to install phpMyAdmin to administer my database or mocking with iptables, I’ve decided to use SSH tunneling and MySQL Workbench to do just that.

You can use the following command to tunnel the remote port 3306 of your VPS to the locally available port 8888:

If all worked well, you will be logged into your remote machine and, while keeping that terminal window open, you will be able to use MySQL Workbench to connect to 127.0.0.1:8888 in order to access your database. By the way, you don’t have to use  8888 for your local port, I use  3306 locally as well, in which case the command becomes: