Help with PHP to mysql connection.
Posted: Wed Sep 17, 2008 10:29 pm
Hi Guys,
I need help on connecting my php website to the mysql database. My mysql database is located on my webhosting server.
First I need to sftp(login) to my web server, followed by ssh(login) to my database server, the ip is 192.168.XXX.XXX. This database is located in /home/mywebsite/
The question is how do I code my php so that I can connect to my server. I cannot get it to work with localhost nor using the ip. The error I get is "Unable to connect to MySQL".
Help greatly appreciated. If I have missed any useful information do let me know.
Thanks,
John
I need help on connecting my php website to the mysql database. My mysql database is located on my webhosting server.
First I need to sftp(login) to my web server, followed by ssh(login) to my database server, the ip is 192.168.XXX.XXX. This database is located in /home/mywebsite/
The question is how do I code my php so that I can connect to my server. I cannot get it to work with localhost nor using the ip. The error I get is "Unable to connect to MySQL".
Help greatly appreciated. If I have missed any useful information do let me know.
Thanks,
John