I Googled this topic, and could not find an answer.
I am working on a site for someone and I need access to their MySQL database. They only gave me localhost access and the username and password.
How do I connect to the database through a tool like Dbninja?
Thanks!
You can use ssh port forwarding to map a local port to a port on their server.
Here’s a short article that gives an introduction to how to do this:
http://onlamp.com/onlamp/excerpt/ssh_11/index3.html
Here’s an article on how to do it if you use the terminal program putty on windows:
http://katsande.com/ssh-port-forwarding-for-mysql-using-putty
Basically, you ssh to the remote machine and then ‘map’ a port on that machine to a port on your local machine. Then you can connect your db program to the local port and it will be as if you were connecting to the remote machine from localhost.