Posted by afrinspray on 02/23/06 23:22
Ok,
$conn = mysql_connect($mysql_host, $username, $password, true);
Where
$mysql_host = another server (db.example.com)
$username = the username in the mysql database
$password = the password of the the user above
This all works if I use the command line mysql command with the -h
command for specifying a host. It's just through php that I get the
/tmp/mysql.sock does not exist error. I'm just confused why php would
require the socket if it's not connecting to mysql locally. Does PHP
require that the localhost have a mysql server installed even if I'm
connecting to a remote server?
[Back to original message]
|