I need to establish an SSH tunnel so that my local PHP script can connect to a MySQL server on a remote server.
Remote machine: MySQL (127.0.0.1:3306) on Linux (SSH port 44422)
Local machine: Linux (Debian Squeeze)
The problem is that it doesn't allow me to connect with this command:
ssh -oPort=44422 user@ip_address
How do I establish an SSH tunnel so that my PHP script can connect to the remote MySQL?
(If you believe that an alternative connection method, such as establishing SSH tunnel via PHP script is better, please let me know.)
Thanks in advance!
EDIT: I forgot to mention that the SSH has a separate username/password and MySQL has another username/password.