NYCPHP Meetup

NYPHP.org

[nycphp-talk] Long MySQL processes, connections

Matt Roberts matt at matt-roberts.net
Sat Oct 22 16:15:00 EDT 2005


I'm using mysql_connect() to access a MySQL database at the beginning  
of a PHP script.

This script does long process of a large recordset, and generally  
takes 30-40 minutes to process all records.

My question: what's the best way to handle this long connection?  
Could someone please explain the behind the scenes / best practice  
around MySQL var "wait_timeout" ?  Sometimes the process hangs -  
could it be related to this timeout variable?  As a workaround I  
connect and disconnect at the top and bottom of the processing loop -  
is this a bad idea?

Thanks!
Matt

Matt Roberts
matt at matt-roberts.net






More information about the talk mailing list