Php: Mysql connect with ssh hostname
In my sql host environment when I try to connect to mysql I have to go through a ssh host. Here is my connection:
ssh hostname: server01 username : user pwd: password mysqlhostname : mysql01 port : 3306 username : mysqluser pwd: mysqlpwd
How can I connect to the database in php?
You can't. What you need to do is setup an SSH tunnel from your webserver to your SSH host and then use localhost with the port of your tunnel in PHP.