On Sun, 26 Nov 2000, Jurupari wrote:
> > Do you have pam_ldap and nss_ldap installed as well?
> 
> I have neither installed.
> 
> I exact error I am getting is as follows:
> Warning: MySQL Connection Failed: Can't connect to local MySQL server 
> through socket '/tmp/mysql.sock' (111) in /var/www/html/dbs/db-
> email.php on line 12.
> 
> Line 12 of that php file works fine on a RH 6.2 system, and it reads 
> as follows:
> $db = mysql_connect("localhost", "apache");
> 
> If I were to run the MySQL client from the command line like this 
> 'mysql -u apache' I can connect to the server, change to the 
> appropriate database and perform a query on it. I believe that I have 
> the correct rights set up within the mysql database. I am not sure 
> what the problem is.
> 
> ---Here's a thought that just hit me.... The error above mentions not 
> being able to connect to the socket '/tmp/mysql.sock'  Hmmmm, the 
> server is running and that sock file is not in /tmp. It resides in 
> /var/lib/mysql with the databases. Is this the problem????  How could 
> I fix it? Where do I tell PHP where the sock file is?

Easy fix (maybe; not sure if it works with sockets):

ln -s /var/lib/mysql/mysql.sock /tmp

Harder fix:

change your php code to use the machine's hostname instead of localhost:

$db = mysql_connect("blah.example.com", "apache");

..which will have it communicate via TCP/IP instead of UNIX
sockets. You'll have to make sure that your database has proper
permissions for this to work.

Not sure how to get PHP to look somewhere else for the socket file..

-- 
Nate Carlson <natecars at real-time.com>   | Phone : (952)943-8700
http://www.real-time.com                | Fax   : (952)943-8500