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
Help with PHP to mysql connection.
Moderator: General Moderators
-
onedollartotown
- Forum Newbie
- Posts: 1
- Joined: Wed Sep 17, 2008 10:28 pm
- Bill H
- DevNet Resident
- Posts: 1136
- Joined: Sat Jun 01, 2002 10:16 am
- Location: San Diego CA
- Contact:
Re: Help with PHP to mysql connection.
Code: Select all
$Host = "xxxxxx"; // server name
$User = "xxxxxx"; // database param
$Password = "xxxxxx"; // database param
$Link = mysql_connect($Host, $User, $Password);