Bug #73757 [Opn]: Slow connection when using localhost as DSN
| From: | binarskugga at gmail dot com | Date: | Fri, 16 Dec 2016 08:00:12 +0000 |
| Subject: | Bug #73757 [Opn]: Slow connection when using localhost as DSN | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206052@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73757&edit=1
ID: 73757
User updated by: binarskugga at gmail dot com
Reported by: binarskugga at gmail dot com
Summary: Slow connection when using localhost as DSN
Status: Open
Type: Bug
Package: PDO MySQL
Operating System: Windows
PHP Version: 7.1.0
Block user comment: N
Private report: N
New Comment:
Tested with MySQL.
Previous Comments:
------------------------------------------------------------------------
[2016-12-16 07:59:05] binarskugga at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/pdo.construct
---
When connecting to PDO using the DSN, it is painfully slow on local if you're using
"localhost". This can be fixed by using 127.0.0.1 at the moment.
Test script:
---------------
<?php
try {
$pdo = new PDO(mysql:dbname=foo;host=localhost;port=3306",
$config["SQL"]["USER"], $config["SQL"]["PASSWORD"]);
} catch(PDOException $exception) {
die("Couldn't access SQL engine. (" . $exception->getMessage() .
")");
}
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73757&edit=1