Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my $dbh_m= DBI->connect("dbi:mysql:XXX","root","XXX","mysql_auto_reconnect=1")
- my $dbh;
- {
- local $@;
- do {
- eval {
- $dbh = DBI->connect("dbi:mysql:XXX", "root", "XXX", { mysql_auto_reconnect => 1 })
- };
- if ( $@ ) {
- warn "Error: $DBI::errstrn";
- warn "Trying to reconnect in 5 sec.n";
- sleep 5;
- }
- } while ($@);
- }
- DBI->connect("dbi:mysql:XXX", "root", "XXX", { mysql_auto_reconnect => 1 })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement