|  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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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: Tue Feb 27 03:01:28 2024 UTC