MySQL server has gone away during crawling in Perl

前端 未结 3 2020
耶瑟儿~
耶瑟儿~ 2021-01-23 22:44

I use WWW::Mechanize library to get the content of URLs and save their data into mysql tables. But when the page\'s content is too large, it gives this error message:

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-23 23:26

    Are you using the latest DBI and DBD::mysql? It should have mysql_auto_reconnect enabled.

    If you're using mysql under forks, you may need to set

    $dbh->{InactiveDestroy} = 1;
    

提交回复
热议问题