Re: PHP and MySQL auth?

From: Date: Tue, 28 Aug 2001 19:48:56 +0000
Subject: Re: PHP and MySQL auth?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-64873@lists.php.net to get a copy of this message
Case 2. Without any form of auth, I read the text file and do
       mysql_connect($the_db_host,$the_db_username,$the_db_pass);
    mysql_select_db($the_db_name);
    mysql_query("select * from table");
and the server response is: Error 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock; (111)
This really is a faq. Mysql.sock normally lives in /tmp think RH puts it in /var/lib PHP can't find it. Might be php.ini looks in /var/lib change it there to match the location of you mysql.sock .. also .. check if mysql is running (ps ax | grep mysql). If it isn't you can't connect to it. Bye, B.

« previous php.general (#64873) next »