URGENT: mysql_connect fails
Posted on 2006-04-09
I am trying to setup a local linux box as a development enviornment for my project. This is my first real crack at setting up a linux server. At this point I have all the major pieces on and working (apache, php, mysql, etc) but I am having trouble getting php to connect to mysql. I can get to mysql just fine from the command line or through gui toolsso it's up and running but when my php scripts try and connect I get the following error
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /var/sites/sitename/html/includes/database.php on line 558
I've been looking all over the web for solutions and tried almost everything but haven't had any luck. So here is what I have tried let me know what I need to do...
I tried changing the location of the mysql.sock file from /var/lib/mysql/mysql.sock to /tmp/mysql.sock through the /etc/my.cnf file then I went into the php.ini file and altered the default socket to point to /tmp/mysql.sock... and restart mysql and apache but the error continued....
I've checked permissions and those are fine.
I've tried passing the socket location '/tmp/mysql.sock' in through the mysql_connect function and still get the same error except the '/var/lib/mysql/mysql.sock' not says /tmp/mysql.sock
The version of of software are as follows...
OS = Fedora Core 4
php = 4.3.11-2.8
mysql = 4.1.16-1
apache = 2.0.54-10
any ideas? this is the last step to me being able to use this box....