Edit report at http://bugs.php.net/bug.php?id=52516&edit=1

 ID:                 52516
 Updated by:         johan...@php.net
 Reported by:        dev at focus-computing dot com dot au
 Summary:            host name of localhost doesn't work any more
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            MySQL related
 Operating System:   Windows 7
 PHP Version:        5.3.3
 Block user comment: N

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Please see this blog post:
http://blogs.iis.net/donraman/archive/2010/06/11/php-5-3-and-mysql-connectivity-problem.aspx


Previous Comments:
------------------------------------------------------------------------
[2010-08-02 15:32:19] dev at focus-computing dot com dot au

Description:
------------
When asked to specify a server in a TCP/IP environment the name
'localhost' has always worked - it works with lots of other packages. 
However it is clearly not working with the latest mysqlnd driver.  We
have to specify 127.0.0.1 - which to me has always been synonymous with
'localhost'.



Can we please have the option of specifying 'localhost' back?



I understand there are technical reasons for using the IP address, but
this is really hard to explain to our bosses: why the upgrade failed,
why the system was down for 3 days, and specifically why this setting
was changed to begin with - they just don't understand - I barely
understand.



Two lines of code should do it:

if ($servername == 'localhost')

  $servername = '127.0.0.1';



PS: I know I've written php but the C code is equally short.





Test script:
---------------
mysql_connect('localhost', 'root', 'secret');

mysql_connect('127.0.0.1', 'root', 'secret');



Expected result:
----------------
To be able to specify the mysql server name as 'localhost'



------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52516&edit=1

Reply via email to