[wp-trac] [WordPress Trac] #41722: wpdb::db_connect() does not connect to IPv6 address of mysql server

WordPress Trac noreply at wordpress.org
Tue Oct 10 15:52:05 UTC 2017


#41722: wpdb::db_connect() does not connect to IPv6 address of mysql server
-------------------------------------------------+-------------------------
 Reporter:  fierevere                            |       Owner:  pento
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  4.9
Component:  Database                             |     Version:  4.8.1
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing has-unit-    |     Focuses:
  tests                                          |
-------------------------------------------------+-------------------------
Changes (by markjaquith):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 This broke socket connections.

 My `DB_HOST` looks like this:

 `define( 'DB_HOST', ':/Applications/MAMP/tmp/mysql/mysql.sock' );`

 What happens is that `$port` ends up being an empty string, which is not a
 valid value.

 > Warning: mysqli_real_connect() expects parameter 6 to be integer, string
 given in /Users/mark/svn/wp-dev/trunk/src/wp-includes/wp-db.php on line
 1498

 And thus the connection fails.

 > Warning: mysqli_get_server_info(): invalid object or resource mysqli in
 /Users/mark/svn/wp-dev/trunk/src/wp-includes/wp-db.php on line 3329

 `$port` should remain null, if no actual value is extracted.

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


More information about the wp-trac mailing list