MySQL error: 2013 Lost connection to MySQL server during query