#38996 [NEW]: PDO persistant connection breaks on mysql restart
| From: | fifthnormal at hotmail dot com | Date: | Fri, 29 Sep 2006 19:13:28 +0000 |
| Subject: | #38996 [NEW]: PDO persistant connection breaks on mysql restart | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-102904@lists.php.net to get a copy of this message | ||
From: fifthnormal at hotmail dot com
Operating system: Linux
PHP version: 5.1.6
PHP Bug Type: PDO related
Bug description: PDO persistant connection breaks on mysql restart
Description:
------------
Hello,
I am using PDO as a database layer to connect to MySQL. I add the
attribute to use a persistant connection. This works as expected
If the MySQL server is restarted, then PHP responds with this error
message:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
From this point on the connection won't work. This error message will only
go away after httpd has been restarted.
Thanks,
Daniel Burge
Reproduce code:
---------------
<?
//Run this to ensure that the connection is being made and persisted, then
restart your mysql database
$dbh = new
PDO("mysql:host=dbserver;dbname=databasename","username","password",
array(PDO::ATTR_PERSISTENT => true));
?>
Expected result:
----------------
I would expect that PDO would reestablish the connection if it drops.
Actual result:
--------------
PDO returns the error message:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
--
Edit bug report at http://bugs.php.net/?id=38996&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38996&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38996&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38996&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38996&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38996&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38996&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38996&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38996&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38996&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38996&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38996&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38996&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38996&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38996&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38996&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38996&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38996&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38996&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38996&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38996&r=mysqlcfg