[techtalk] mysql and php

Harald Welte laforge at gnumonks.org
Thu Dec 21 00:24:15 EST 2000


On Wed, Dec 20, 2000 at 05:04:39PM -0500, Nicki Handy wrote:
> Hi-
> I'm running apache red hat linux 6.1, with mysql and php- I have a fine 
> time with *perl* and mysql talking to each other but this is the error I 
> get with my test php page-
> Warning: MySQL Connection Failed: Can't connect to local MySQL server 
> through socket '/var/lib/mysql/mysql.sock' (111) in 
> /home/httpd/html/phpdbitest.php on line 5
> Could not connect
> 
> that file  mysql.sock is located in /tmp/mysql.sock not the directory it 
> lists in the warning- I don't want to make a link to a tmp directory and I 
> don't really know what this files is doing exactly. anyway, any suggestions?

The file is a unix domain socket, the socket over which a mysql client
connects to a local server on the same machine.

I've never heared about this problem, it seems like your mysql client
libraries and the mysql server weren't built with the same configuration.

linking the file wouldn't buy you anything, because the socket vanishes
once your mysqld terminates.

You can specify the path of the socket mysql uses via the environment
variable MYSQL_UNIX_PORT=/foo/bar at daemon start time. You may want to
set (and export!) this variable in your mysql - init script.

If your init script is running safe_mysqld (which is a shell-script),
you can make it call 'safe_mysqld --socket=/foo/bar'. safe_mysqld takes
care of setting and exporting the apropriate environment variable.
 
> Thanks,
> Nicki

-- 
Live long and prosper
- Harald Welte / laforge at gnumonks.org                http://www.gnumonks.org
============================================================================
GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M- 
V-- PS+ PE-- Y+ PGP++ t++ 5-- !X !R tv-- b+++ DI? !D G+ e* h+ r% y+(*)




More information about the Techtalk mailing list