Bug #50357 [NoF->Fbk]: PDO_Mysql Not work.
| From: | felipe@php.net | Date: | Sun, 25 Apr 2010 18:42:25 +0000 |
| Subject: | Bug #50357 [NoF->Fbk]: PDO_Mysql Not work. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-149896@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=50357&edit=1
ID: 50357
Updated by: felipe@php.net
Reported by: ghxter at gmail dot com
Summary: PDO_Mysql Not work.
-Status: No Feedback
+Status: Feedback
Type: Bug
Package: PDO related
Operating System: Windows 7 X86
PHP Version: 5.3.1
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2010-02-07 01:00:00] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2010-01-30 03:46:33] rasmus@php.net
Is this the ipv6 localhost problem again? Does connection to 127.0.0.1
instead of localhost work? If so, add an ipv4 entry for localhosts to
your hosts file.
------------------------------------------------------------------------
[2010-01-30 03:39:48] richardcpelletier at gmail dot com
I am using Vista Home x64 and I am encountering this problem as well. I
have disabled all firewalls and I had no difficulty with PHP 5.2.
------------------------------------------------------------------------
[2009-12-02 05:52:09] ghxter at gmail dot com
More Info:
PHP Warning: PDO::__construct(): [2002]
ÓÉÓÚÁ¬½Ó·½ÔÚÒ»¶Îʱ¼äºóûÓÐÕýÈ·´ð¸´»òÁ¬½ÓµÄÖ÷»úûÓз´Ó¦£¬Á¬½Ó³¢ÊÔ
(trying
to connect via tcp://localhost:3306) in D:\WebSites\test.php on line 6
------------------------------------------------------------------------
[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/bug.php?id=50357&edit=1