From:
Operating system: Ubuntu 10.04
PHP version: 5.3.3
Package: MySQL related
Bug Type: Bug
Bug description:mysqlnd: host cannot be a hostname
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
--
Edit bug report at http://bugs.php.net/bug.php?id=52434&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52434&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52434&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=52434&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52434&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=52434&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52434&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=52434&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=52434&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=52434&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=52434&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=52434&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=52434&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=52434&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52434&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52434&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52434&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=52434&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=52434&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=52434&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=52434&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=52434&r=mysqlcfg