Hi,

Monday, December 9, 2002, 2:29:35 AM, you wrote:
BJC> Hello!

BJC> When trying to connect to a mysql database under my linux system, I get the
BJC> following error:

BJC> Warning: Can't connect to local MySQL server through socket
BJC> '/var/lib/mysql/mysql.sock' (2) in /webroot/dbconnect.php on line 2

BJC> Here is a copy of the code I am using:

BJC> <?

BJC>     $link =  mysql_connect("localhos" , "username" , "password")
BJC>             or die("Couldn't Connect.");
BJC>   ?>

BJC> I am currently running Apache with Mysql and PHP version 4 on Redhat 8. Any
BJC> suggestions?

BJC> Thank you.
BJC> --
BJC> ---------------------------------------------------------------
BJC> Brian J. Celenza
BJC> [EMAIL PROTECTED]
BJC> ICQ: 100942424
BJC> AIM: BJCKnight

If that is the location of the socket (mysql default is /tmp/mysql.sock but I
don't know with RH)you could try

$link =  mysql_connect(":/var/lib/mysql/mysql.sock" , "username" , "password")

If that fails, check the permissions of the path to the socket for the apache
user and that mysqld is running.
-- 
regards,
Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to