note 13971 added to ref.mysql.php

From: Date: Thu, 12 Jul 2001 07:18:13 +0000
Subject: note 13971 added to ref.mysql.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-15269@lists.php.net to get a copy of this message
On a Caldera eDesktop 2.4 system with apache and mysql from the Caldera RPMs, I installed PHP4.0.5 using --with-mysql='/usr'. This worked ok except that I could not connect to a database using: $link=mysql_connect('localhost',USER, PASSWORD); It would return the error: Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111). MySQL was running and I was able to connect using the mysql client. Setting mysql.default-socket='/var/lib/mysql/mysql.sock' in php.ini did not fix the problem Solutions were: If I changed "localhost" to "127.0.0.1" it worked. If I created a symbolic link '/tmp/mysql.sock' to '/var/lib/mysql/mysql.sock' it would then work using "localhost". As neither of these solutions were ideal, I removed the existing RPMs which came from Caldera and installed the latest Mysql RPMs from MySQL.com (mysql-3.23.39-1.RPM). Problem solved :) Original RPM's on the system were apache-1.3.11-2D.i386.rpm and mysql-3.22.32-3.i386.rpm http://www.php.net/manual/en/ref.mysql.php

« previous php.notes (#15269) next »