MySQL Timeout

A long-running MySQL query gives the following error:

"Lost connection to MySQL server during query"

This happens both in client and fastcgi mode. In comparison, running Zend php in client mode completes the script. The query runs for less than 2 minutes.