List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:August 8 1999 2:45pm
Subject:Forking and MySQL
View as plain text  
>>>>> "frEEk" == frEEk  <freek@stripped> writes:

frEEk> My perl script was running fine till I started forking children to do
frEEk> mailing. Now I get somewhat unpredictable mysql errors:

frEEk> DBD::mysql::db selectrow_array failed: Lost connection to MySQL server
frEEk> during query

frEEk> The forking I am doing does not directly involve any of the mysql calls,
frEEk> and yet I haven't had these problems before. I have looked at some of
frEEk> the more obvious possibilities, like the threads taking the wrong
frEEk> routes, since I suspected mysql may be connected to a particular thread,
frEEk> but the forking is fine. I am only left to think that mysql has some
frEEk> sort of problem with threading, like a side effect. What am I doing
frEEk> wrong?

frEEk> Thank you kindly


You can't do connect + fork and expect it to work.
You must do fork+connect.

The right approach is of course to not use fork but instead use
threads (You can consult the perl development list about this(

Forking and MySQLfrEEk8 Aug
  • Forking and MySQLMichael Widenius8 Aug
Re: Forking and MySQLAntony T Curtis8 Aug
  • Re: Forking and MySQLMichael Widenius8 Aug