ID: 50357
User updated by: ghxter at gmail dot com
Reported By: ghxter at gmail dot com
Status: Open
Bug Type: PDO related
Operating System: Windows 7 X86
PHP Version: 5.3.1
New Comment:
More Info:
PHP Warning: PDO::__construct(): [2002]
ÓÉÓÚÁ¬½Ó·½ÔÚÒ»¶Îʱ¼äºóûÓÐÕýÈ·´ð¸´»òÁ¬½ÓµÄÖ÷»úûÓз´Ó¦£¬Á¬½Ó³¢ÊÔ (trying
to connect via tcp://localhost:3306) in D:\WebSites\test.php on line 6
Previous Comments:
------------------------------------------------------------------------
[2009-12-02 05:50:03] ghxter at gmail dot com
Description:
------------
Mysql Code:
try{
$dbh = new PDO('mysql:host=localhost;dbname=test', 'root', '');
var_dump($dbh);
} catch(Exception $e) {
echo $e->getMessage();
}
Error Info:
SQLSTATE[HY000] [2002]
ÓÉÓÚÁ¬½Ó·½ÔÚÒ»¶Îʱ¼äºóûÓÐÕýÈ·´ð¸´»òÁ¬½ÓµÄÖ÷»úûÓз´Ó¦£¬Á¬½Ó³¢ÊÔʧ°Ü¡£
Env:
Windows7x86 + Mysql5.1.41 + nginx0.7.63.
I tested from php5.2.6 to php.5.2.11 And php5.3.0 are work.
but php.5.3.1 and php.5.3.2 are not work.
Reproduce code:
---------------
try{
$dbh = new PDO('mysql:host=localhost;dbname=test', 'root', '');
var_dump($dbh);
} catch(Exception $e) {
echo $e->getMessage();
}
Expected result:
----------------
---------- PHPTest ----------
object(PDO)#1 (0) {
}
Actual result:
--------------
---------- PHPTest ----------
SQLSTATE[HY000] [2002]
ÓÉÓÚÁ¬½Ó·½ÔÚÒ»¶Îʱ¼äºóûÓÐÕýÈ·´ð¸´»òÁ¬½ÓµÄÖ÷»úûÓз´Ó¦£¬Á¬½Ó³¢ÊÔʧ°Ü¡£
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50357&edit=1