One of the classic problems in administering databases is providing secure, yet accessible tools for all those who need to run queries or examine production data. Classically, phpMyAdmin has been a great tool for handling MySQL for those who don’t know the command line. However, as any sysadmin worth his salt knows, it’s an extremely insecure tool for a couple of reasons.
All of these things are bad, since garden variety attackers and script kiddies can potentially find your phpmyadmin installation. Since phpMyAdmin is open- source, and freely available, there always likely to be security holes. One of the best ways around this is to close phpMyAdmin off to the public via firewall, and then use an SSH tunnel to pass traffic through another server. The server hosting mysql and phpMyAdmin can safely stay hidden, with all ports closed.
Set up looks something like this (on a Mac, at least).
Install MacPorts
Install Xcode command line dev tools.
Open Xcode -> Preferences -> Downloads -> Command Line Tools
$ sudo port install autossh
autossh -M 20002 -f -L 7422:your.db.served.biz.org:7422 your.jump.server.biz
“sleep 99999999999”