$sth = $dbh->prepare ($sql); # im doing a mysql restart $sth->execute (); # DBD::mysql magically reconnects keeping the prepared statement and executes #### $sth= $dbh->prepare ($sql); # stoping mysql $sth->execute (); # DBD::mysql tries, but no connection, reconnecting and trying again will lose the $dbh->prepare #### $sth= $dbh->prepare ($sql); # stoping mysql $sth->execute (); # entering reconnect mode in MyDBI::st/db: while (!$dbh->ping) { sleep 5; MyDBI->connect_like_mysql_reconnects; }