Page 1 of 1

MySQL Query Failed: Lost connection to MySQL server during query

Posted: 26 Oct 2018, 19:14
by copiousquirk
Hi, I have about 12000 Candidate records now but I can't load the Candidates Tab. It keeps circling and then it'll either work finally OR most likely the below message error. Can someone point me in the right direction? do i need to upgrade my hosting RAM? or is this a different issue?
Query Error -- Report to System Administrator ASAP


MySQL Query Failed: Lost connection to MySQL server during query

SELECT SQL_CALC_FOUND_ROWS
candidate.candidate_id AS candidateID,
candidate.candidate_id AS exportID,
candidate.is_hot AS isHot,
candidate.date_modified AS dateModifiedSort,
candidate.date_created AS dateCreatedSort,
IF(candidate_joborder_submitted.candidate_joborder_id, 1, 0) AS submitted,
IF(attachment_id, 1, 0) AS attachmentPresent,
owner_user.first_name AS ownerFirstName,owner_user.last_name AS ownerLastName,CONCAT(owner_user.last_name, owner_user.first_name) AS ownerSort,
DATE_FORMAT(candidate.date_modified, '%m-%d-%y') AS dateModified,
DATE_FORMAT(candidate.date_created, '%m-%d-%y') AS dateCreated,
candidate.state AS state,
candidate.key_skills AS keySkills,
extra_field1.value AS extra_field_value1,
candidate.first_name AS firstName,
candidate.last_name AS lastName,
candidate.email1 AS email1,
candidate.phone_cell AS phoneCell,
candidate.notes AS notes,
extra_field0.value AS extra_field_value0,
extra_field2.value AS extra_field_value2,
candidate.current_employer AS currentEmployer,
candidate.current_pay AS currentPay
FROM
candidate
LEFT JOIN attachment
ON candidate.candidate_id = attachment.data_item_id
AND attachment.data_item_type = 100
LEFT JOIN candidate_joborder AS candidate_joborder_submitted
ON candidate_joborder_submitted.candidate_id = candidate.candidate_id
AND candidate_joborder_submitted.status >= 400
AND candidate_joborder_submitted.site_id = 1
AND candidate_joborder_submitted.status != 650
LEFT JOIN user AS owner_user ON candidate.owner = owner_user.user_id
LEFT JOIN extra_field AS extra_field1 ON candidate.candidate_id = extra_field1.data_item_id AND extra_field1.field_name = 'Department' AND extra_field1.data_item_type = 100
LEFT JOIN extra_field AS extra_field0 ON candidate.candidate_id = extra_field0.data_item_id AND extra_field0.field_name = 'Title' AND extra_field0.data_item_type = 100
LEFT JOIN extra_field AS extra_field2 ON candidate.candidate_id = extra_field2.data_item_id AND extra_field2.field_name = 'Work Auth' AND extra_field2.data_item_type = 100 LEFT JOIN saved_list_entry
ON saved_list_entry.data_item_type = 100
AND saved_list_entry.data_item_id = candidate.candidate_id
AND saved_list_entry.site_id = 1
WHERE
candidate.site_id = 1
AND candidate.is_admin_hidden = 0


GROUP BY candidate.candidate_id

ORDER BY dateModifiedSort DESC
LIMIT 0, 100

Re: MySQL Query Failed: Lost connection to MySQL server during query

Posted: 26 Oct 2018, 23:56
by RussH
well.. you've probably got a slow query? Do you host this yourself, or on a VPS etc?

Make sure you're not running an old version of MySQL!
Configure MySQL to log slow queries to the slow query log and see what's happening.
Look at the MySQL Tuner Perl script to see if you need to optimise your MySQL instance.
I have about 10,000 candidate records and don't have this issue.

Re: MySQL Query Failed: Lost connection to MySQL server during query

Posted: 29 Oct 2018, 14:07
by copiousquirk
I host this on GoDaddy online.

Will check if there is a new version of MySQL. Will upgrading it mess something else up?
Also will get MySQL to log slow queries and below instructions.

Thanks for the help

Re: MySQL Query Failed: Lost connection to MySQL server during query

Posted: 29 Oct 2018, 15:27
by RussH
maybe you have a session timeout someplace if you have this on GoDaddy. I doubt they'd let you configure that. I used to have some slow queries on an old MySQL, but after a MySQL upgrade it disappeared.

Re: MySQL Query Failed: Lost connection to MySQL server during query

Posted: 10 Nov 2018, 21:08
by copiousquirk
Is there a way i can increase the timeout so i can still use the candidates tab for now?

It'll be slow to open up but at least i can still use until i can figure this out.

Re: MySQL Query Failed: Lost connection to MySQL server during query

Posted: 12 Nov 2018, 12:33
by RussH
If you can edit php.ini then this is what you need; https://stackoverflow.com/questions/382 ... out-in-php

Re: MySQL Query Failed: Lost connection to MySQL server during query

Posted: 15 Nov 2018, 15:12
by copiousquirk
On Godaddy, I found it here incase anyone else has this problem

https://imgur.com/a/A9AxZpW