[wp-trac] [WordPress Trac] #33842: wp-options.php ignores port for mysql when database is localhost

WordPress Trac noreply at wordpress.org
Sat Sep 12 19:41:24 UTC 2015


#33842: wp-options.php ignores port for mysql when database is localhost
----------------------------+------------------------------
 Reporter:  carles_mateo    |       Owner:
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Bootstrap/Load  |     Version:  4.3
 Severity:  normal          |  Resolution:  invalid
 Keywords:  needs-codex     |     Focuses:
----------------------------+------------------------------
Changes (by kitchin):

 * keywords:   => needs-codex
 * status:  new => closed
 * resolution:   => invalid


Comment:

 PHP treats `localhost` differently than `127.0.0.:1`.

  Whenever you specify "localhost" or "localhost:port" as server, the MySQL
 client library will override this and try to connect to a local socket
 (named pipe on Windows). If you want to use TCP/IP, use "127.0.0.1"
 instead of "localhost". If the MySQL client library tries to connect to
 the wrong local socket, you
 shouldhttp://php.net/manual/en/mysqli.construct.php set the correct path
 as in your PHP configuration and leave the server field blank.
 http://php.net/mysql_connect
 See also the comment at http://php.net/manual/en/mysqli.construct.php

 I'll take a go at the codex.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33842#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list