php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16285 mysql connection uses bogus hostname
Submitted: 2002-03-26 07:59 UTC Modified: 2002-04-25 17:28 UTC
Votes:7
Avg. Score:4.1 ± 0.8
Reproduced:5 of 6 (83.3%)
Same Version:4 (80.0%)
Same OS:3 (60.0%)
From: x at psynchro dot org Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.1.2 OS: Linux 2.4.7-10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: x at psynchro dot org
New email:
PHP Version: OS:

 

 [2002-03-26 07:59 UTC] x at psynchro dot org
[This is actually a 4.2.0rc1 issue, but there isn't an option for that in the dropdown]

When connecting to mysql with php 4.2.0rc1, having specified 'localhost' as the hostname, 'localhost.localdomain' is actually passed to the mysql server. (Reported in both the error message, and the mysql log.)

This behaviour was seen initially when attempting to use ACID and phpMyAdmin.

After reversion back to php 4.1.2, however, 'localhost' is again passed as expected.

config args: --with-mysql --with-imap --with-kerberos --with-apxs --with-imap-ssl --with-gd

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-26 08:00 UTC] derick@php.net
Reproduced
 [2002-04-24 09:42 UTC] yavuz at qweb dot nl
I had the same problems. What I did was the following:
edit the file /etc/hosts

It contained:
127.0.0.1       localhost.localdomain localhost

It's now:
127.0.0.1       localhost localhost.localdomain

After reboot it works now.
 [2002-04-24 09:55 UTC] derick@php.net
Yes, that works. But the mysql client just doesn't use the UNIX domain sockets anymore... which is really what you want.

Derick
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Fri Feb 13 09:00:01 2026 UTC