|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #42901 Add a flag to PDO_mysql for reconnection in case of timeouts
Submitted: 2007-10-09 13:45 UTC Modified: 2011-04-18 14:16 UTC
From: soenke at jimdo dot com Assigned: mysql (profile)
Status: Wont fix Package: MySQL related
PHP Version: 5.2.4 OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: soenke at jimdo dot com
New email:
PHP Version: OS:


 [2007-10-09 13:45 UTC] soenke at jimdo dot com
For long-running PHP script with database connections it would be nice if the database driver automatically reconnects in case of a server/network timeout.

This could be integrated with a reconnect flag for PDO. 

At least in libmysqlclient >= 5.0.13 MYSQL_OPT_RECONNECT is available.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-09 13:50 UTC] soenke at jimdo dot com
Here is working code from lighttpd mod_mysql_vhost:
 [2011-01-01 23:55 UTC]
-Package: Feature/Change Request +Package: MySQL related
 [2011-01-06 16:20 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: mysql
 [2011-04-18 14:16 UTC]
-Status: Assigned +Status: Wont fix
 [2011-04-18 14:16 UTC]
Doing this in the driver level means that your application will "suddenly" loose its state (transactions, temp table, session vars, probably including encoding settings, ...) this is fine for vhost configuration as there's not much state, in an application it's better to do it inside an database wrapper and react properly.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 22 17:01:44 2024 UTC