php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16741 mysql_connect maps localhost to localhost.localdomain
Submitted: 2002-04-23 00:57 UTC Modified: 2002-04-25 17:26 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: koonyin at siukoon dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.2.0 OS: Redhat 7.2
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: koonyin at siukoon dot com
New email:
PHP Version: OS:

 

 [2002-04-23 00:57 UTC] koonyin at siukoon dot com
It happens in 4.2.0, not 4.1.2.

mysql_connect("localhost", "username", "password") maps the host from "localhost" to "localhost.localdomain".

It results "Warning: Host 'localhost.localdomain' is not allowed to connect to this MySQL server in /blah/blah/blah/db_connect.php on line N".

Current resolution: Grant localhost.localdomain in MySQL.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-23 02:01 UTC] fmouse at fmp dot com
Same thing happens on Debian testing.  Same php.ini, same web server, same script.  "Can't connect to MySQL server on 'localhost' (111) in /var/www/index.php" etc. etc.  No problem with 4.1.2.
 [2002-04-23 04:23 UTC] sander@php.net
Dupe of #16285
 [2002-04-23 11:36 UTC] franco at i-m-c dot it
Same with debian potato with php 4.2.0 and mysql 4.23.49a
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 01:01:32 2025 UTC