Thursday, August 22, 2013


I prefer PostgreSQL, which is the core of our business at pgExperts. But I still have some legacy clients on MySQL. For one of them, I'm writing new features in Perl/MySQL. The mysql_auto_reconnect option just saved my day. I'd been getting errors like "DBD::mysql::st execute failed: MySQL server has gone away." To use it in DBI, do
my $dbh = DBI->connect(
    { mysql_auto_reconnect => 1 },
To use it in Rose::DB::Object, do
File MyApp::DB;
our @ISA = qw( Rose::DB );

    mysql_auto_reconnect => 1,