[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help : php cannot connect to local mysql server



On Wed, 2004-02-11 at 20:25, Wang Hui wrote:
> Dear all,
> 
> I have a problem when I make my php scripts connecting to the local mysql server.  
> 
> When the php scripts running, it returns that: 
> 
> MySQL said: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
> 

Apache is chroot(2)ed by default. When PHP looks for
/var/run/mysql/mysql.sock, its actually looking for
/var/www/var/run/mysql/mysql.sock

Copy, link, whatever you like to get the file in the proper spot. Check
the archives for details.

> But if I use the 'mysql' command in consol mode, I can connect to the local server.  So the server itself is running.  And what's more, I checked that there exists a file named '/var/run/mysql/mysql.sock'.  So I am puzzled what the problem here ?
> 
> I am using the latest OpenBSD version with MYSQL package installed. 
> 
> I am expecting your suggestions. Thanks in advance ...
> 
> best regards, 
> Wang Hui 
-- 
Christopher M. Ingram
  http://www.christopheringram.com, http://techdiscussions.com
  http://lineman.net, http://secomgroup.com