php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10786 localhost now fails in mysql_(p)connect
Submitted: 2001-05-10 08:44 UTC Modified: 2001-05-11 18:14 UTC
From: davidv at angliaed dot co dot uk Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0.5 OS: Linux SuSE 7.1/Mandrake 7.2
Private report: No CVE-ID: None
 [2001-05-10 08:44 UTC] davidv at angliaed dot co dot uk
Two systems have been upgraded from 4.0.4pl1 to 4.0.5 and both have then failed to connect to a MySQL database using 'localhost' in the mysql_connect or mysql_pconnect calls. The MySQL installation has not been upgraded. Replacing the libphp4.so with the 4.0.4pl1 version and restarting apache fixes the problem as does changing 'localhost' to '127.0.0.1' (plus a similar mod to mysql db and user tables in the database so that the host names match).

The MySQL version is 3.23.32

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-10 08:53 UTC] derick@php.net
What is the error message you get?
Can you also try to set: mysql.default_socket to the location where you mysql soscket is?
(Probably: /tmp/mysql.sock or /var/lib/mysql.sock).
 [2001-05-11 04:03 UTC] davidv at angliaed dot co dot uk
Thanks for the quick reply.

The error message was indicating that it couldn't find the mysql.sock file and your suggestion of pointing the entry in php.ini to that location fixed the problem immediately.

The new location on one machine was /var/lib/mysql/mysql.sock - I don't have the correct permissions on the other machine to update php.ini as this is run by another company. Interestingly enough, I upgraded a third machine yesterday after your email arrived and this worked flawlessly - it was running RedHat 6.1/MySQL 3.23.27-beta and the mysql.sock was located in the expected place in /tmp.

However, this still does not explain why previous versions of PHP can find the mysql.sock file without problem while 4.0.5 has trouble - I note that there has been quite a few changes to the ext/mysql/php_mysql.c file and suppose that something has been slightly broken there. Is this likely to be fixed?

Thanks again


 [2001-05-11 18:14 UTC] sniper@php.net
This is fixed already in CVS.

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 28 07:01:29 2024 UTC