Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Everyone,

When trying to connect to MySQL via php, the following error message is displayed: Can't connect to local MySQL server
through socket '/var/lib/mysql/mysql.sock' (13)
This is the first time I have seen this error message after a fresh installation.

Here's what's been done so far.

installed rpm's from mysql.com for RHEL 4AS
compiled php 5.0.4 from source
	./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-force-cgi-redirect \
	--enable-discard-path --enable-fastcgi --disable-path-info-check \
	--enable-sigchild --enable-magic-quotes --with-openssl --with-zlib \
	--enable-calendar --with-jpeg-dir --with-png-dir --with-zlib-dir \
	--with-ttf --with-freetype-dir --with-t1lib --enable-gd-native-ttf \
	--with-mysql=/usr  --with-readline --with-snmp --with-gd
compile apache 2.0.54 (standard compile)

copied /usr/share/mysql/my.medium -> /etc/my.conf

Verified that socket = /var/lib/mysql/mysql.sock

PHPinfo reveils the following:
	Client API version -> 4.1.12
	MYSQL_MODULE_TYPE 	-> external
	MYSQL_SOCKET		-> /var/lib/mysql/mysql.sock
	MYSQL_INCLUDE		-> -l/usr/include/mysql
	MYSQL_LIBS			-> -L/usr/lib -lmysqlclient

apache error log: [client 10.70.0.26] PHP Warning:  mysql_connect() [<a
href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (13) in /usr/local/apache2/htdocs/test.php on line 5

[root@dunnotar mysql]# ls -lta mysql.sock 
srwxrwxrwx  1 mysql mysql 0 Jun 21 14:37 mysql.sock
[root@dunnotar mysql]# pwd
/var/lib/mysql
[root@dunnotar mysql]#

[root@dunnotar mysql]# netstat -ln | grep mysql
unix  2      [ ACC ]     STREAM     LISTENING     8541   /var/lib/mysql/mysql.sock
[root@dunnotar mysql]# 

So.. as you can see.. I am stumped.. Any thought or suggestions on where to go from here..

Thanks..

-- Dominique

-----
Dominique Démoré
Technical Services Coordinator
Rainbow District School Board
69 Young Street
Sudbury, Ontario
P3E 3G5
Tel: (705) 674-3171 x. 258
Fax: (705) 671-2442

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux