Re: mysql_connect problem under RedHat 8.0 ?

From: Date: Sun, 08 Dec 2002 16:45:30 +0000
Subject: Re: mysql_connect problem under RedHat 8.0 ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-127437@lists.php.net to get a copy of this message
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" , BJC> "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> bcelenza@mdreamworks.net 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

« previous php.general (#127437) next »