|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-07-25 06:31 UTC] dtajchreber@php.net
-Status: Open
+Status: Bogus
[2010-07-25 06:31 UTC] dtajchreber@php.net
[2010-07-25 09:05 UTC] anthon dot pang at gmail dot com
-Summary: mysqlnd: host cannot be a hostname
+Summary: mysqlnd: host cannot be "localhost" when connecting
to tcp port
[2010-07-25 09:05 UTC] anthon dot pang at gmail dot com
[2010-07-25 18:33 UTC] johannes@php.net
[2010-07-25 19:00 UTC] anthon dot pang at gmail dot com
[2010-09-16 23:01 UTC] neweracracker at gmail dot com
[2010-09-16 23:30 UTC] pajoye@php.net
[2010-09-17 03:50 UTC] neweracracker at gmail dot com
[2010-09-17 04:15 UTC] anthon dot pang at gmail dot com
[2010-09-17 04:59 UTC] neweracracker at gmail dot com
[2012-10-10 18:21 UTC] register at bazanov dot net
[2013-03-14 12:34 UTC] 45net at rambler dot ru
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 06:00:01 2025 UTC |
Description: ------------ With PDO_MYSQL, if PHP is linked with mysql client libraries (instead of mysqlnd), the DSN can contain a host parameter with a hostname, e.g., host=localhost. However, with mysqlnd, the host has to be an ip address, e.g., host=127.0.0.1. This occurs for '--with-mysqli=mysqlnd' or '--with-pdo-mysql=mysqlnd'. It appears mysqlnd wants to use a Unix socket even though the port is explictly specified, This backward incompatibility surprises users migrating from php 5.2.x and find their apps suddenly can't connect. MySQL 5.1.41 Test script: --------------- From Zend Framework 1.10.6: $_isConnected = @mysqli_real_connect( $this->_connection, $this->_config['host'], $this->_config['username'], $this->_config['password'], $this->_config['dbname'], $port ); Expected result: ---------------- Expect it to connect. Actual result: -------------- Warning: PDO::__construct() [pdo.--construct]: [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in /var/www/libs/Zend/Db/Adapter/Pdo/Abstract.php on line 129 SQLSTATE[HY000] [2002] No such file or directory