Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to do some analysis on data stored in a largish MySQL database. I have 2 tables with 130mio and 600'000 entries respectively and I want to run the following query:

  hashes.hash LIKE 'block%' as block,
  min(timestamp) as min,
  max(timestamp) as max,
  max(timestamp)-min(timestamp) as diff 
  timings left join hashes on (id=timings.hash)
group by

but after a random amount of time (varying between 1 and 18 minutes) I get the following:

$ time mysql timings -e "<query>" > diff2.tsv 
ERROR 2013 (HY000) at line 1: Lost connection to MySQL server during query

real    7m34.158s
user    0m0.004s
sys 0m0.000s

And I get absolutely no message in the log. Any ideas why this might happen?

share|improve this question
What kind of equipment is this running on? Have you checked the kernel logs for messages? – DerfK Aug 15 '12 at 15:46
this is mysql client error - so I doubt you'll find anything in the server logs - unless mysql server was shutdown or crashed during the query.This is hard to investigate, can be related to network issues too. – gyre Aug 15 '12 at 16:07
It's running on my work Desktop, but then again it's "just" a 10GB Database. The MySQL daemon works and the kernel log does not contain any information about the query. I don't think it has anything to do with networking as the mysql client connects to the daemon via a named pipe. – cdecker Aug 15 '12 at 16:32

Your Answer


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

Browse other questions tagged or ask your own question.