Lost connection to MySQL server during query issue SELECT UNIX_TIMESTAMP(a.timestamp) AS timestamp, a.adid, a.adtitle, a.cityid, a.price, 
a.area, a.addesc, a.subcatid, ct.cityname, p.picfile, scat.subcatname, cat.catid, cat.catname 
FROM xzclf_ads a USE INDEX (id_index) 
INNER JOIN xzclf_cities ct ON a.cityid = ct.cityid 
INNER JOIN xzclf_subcats scat ON a.subcatid = scat.subcatid 
INNER JOIN xzclf_cats cat ON scat.catid = cat.catid 
LEFT OUTER JOIN xzclf_adxfields axf ON a.adid = axf.adid 
LEFT OUTER JOIN xzclf_adpics p ON a.adid = p.adid AND p.isevent = '0' 
LEFT OUTER JOIN xzclf_featured feat ON a.adid = feat.adid AND feat.adtype = 'A' 
WHERE scat.catid = 10 
AND a.enabled = '1' 
AND a.verified = '1' 
AND a.expireson &gt;= NOW() 
AND a.paid &lt;&gt; '0' 
AND (feat.adid IS NULL OR feat.featuredtill &lt; NOW()) 
GROUP BY a.adid 
ORDER BY a.timestamp DESC 
LIMIT 0, 20


It gives an error: Lost connection to MySQL server during query
Is anything wrong with this query?
There's a good chance the mysql crashed while trying to execute your query. First check the error log to see if it did. Common reason for mysql crash is memory exhaustion and tmp dir space depletion.