Tell me more ×
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It's 100% free, no registration required.

I have a query being compiled in a template but by the time it's run, it appears that the query module has lost it's connection to the DB:

Error Number: 2013

Lost connection to MySQL server during query

..query here...

Filename: modules/query/mod.query.php

Line Number: 181

Is there any way to extend the database connection period so this can be avoided?

share|improve this question
add comment (requires an account with 50 reputation)

1 Answer

Sounds like you need to increase the connect_timeout setting in my.cnf or adjust your query so it processes faster. If you aren't on a VPS, you'll have to contact your host to figure out how you make the my.cnf change in their setup.

share|improve this answer
I was looking at that and the default is 10 seconds, however this error displays in less than 1 second of refreshing the page. It's a fairly nasty statement with some nested selects, but there are only 4 rows to query so it wouldn't expect to baulk on a vps with 2gb ram running on it. Or at least not to time out until something more meaningful, like 10 seconds. – Russ Back Mar 21 at 16:06
Just ran the query locally in sequel pro and it takes less than 17ms to run. Stumped. – Russ Back Mar 21 at 16:09
I'd suggest contacting the web host. They might be able to see on their end why the connection is failing. – Anna_MediaGirl Mar 21 at 18:55
add comment (requires an account with 50 reputation)

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.