Forums

Can I increase my wait_timeout?

Hi I am using MySQL database for my particular application(designed in python only) in PythonAnywhere . I am processing large Data and performing some operations on it. As almost all are bulk operation which involve fetching from one inventory and then perform operations, that too supplied by third person(timing depends on how much data they are providing).so sometimes I am able to perform operation in Default time 300 seconds specially if I run one particular inventory at a time. But If I run multiple files together sometimes it works and sometimes it won't and gives me error "2013, 'Lost connection to MySQL server during query'" so what I need is more time. Can I make that setting? I tried few commands like
**mysql> SET GLOBAL wait_timeout=500;

ERROR 1227 (42000): Access denied; you need the SUPER privilege for this operation

what can I do to process this problem? and these kind of errors are persistent on scheduled scripts like if I schedule one script on hourly basis in a day if it works for the first time, it might not work for the second time and gives me lost connection error.

The timeouts are there to protect our users from each other and even so, 300s is a very long time to be running a single query. I would suggest that your best approaches would be to optimise your queries and, if that doesn't help enough, work out a way to break the task into chunks that don't run over the timeout.