PHP-MYSQL Error: Can't connect to MySQL socket. Can someone help me out please?

From: Date: Sun, 11 May 2008 04:30:19 +0000
Subject: PHP-MYSQL Error: Can't connect to MySQL socket. Can someone help me out please?
Groups: php.general 
Request: Send a blank email to php-general+get-274124@lists.php.net to get a copy of this message
I am using Fedora Core 4. As I was unable to use PHP or MySQL together, I uninstalled both of them and installed again using the following commands: yum install mysql And then apt-get install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick And then started the mysql server. I am able to connect to the server from the console my typing mysql -h <hostname> -u root -p <mypass> However, when I try to connect to mysql through PHP I get the following errors: PHP Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /export/home/rahul/may/sample.php on line 5 PHP Warning: mysql_query(): A link to the server could not be established in /export/home/rahul/may/sample.php on line 5 Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Can someone please help me out?

« previous php.general (#274124) next »