MySQL Query Failed: Lost connection to MySQL server during query  [SOLVED]

Please describe the issue you're having
If you accept the answer, please mark the topic as [SOLVED] by clicking the tick.

Moderators: RussH, cptr13

Forum rules
Just please remember to play nicely once you walk through the door. You can disagree with us, or any other commenters in this forum, but respect our space and keep your comments directed to the topic at hand.
Post Reply
copiousquirk
Posts: 9
Joined: 25 Jan 2018, 17:05
what is two(2) plus three(3) ?: 5

MySQL Query Failed: Lost connection to MySQL server during query

Post by copiousquirk » 26 Oct 2018, 19:14

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

User avatar
RussH
Site Admin
Posts: 813
Joined: 12 Apr 2008, 08:28
what is two(2) plus three(3) ?: 5
Location: UK
Contact:

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

Post by RussH » 26 Oct 2018, 23:56

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.
RussH

Report your issues and feature requests;
https://github.com/opencats/opencats/issues

Please CLICK THE TICK to accept the answer!

copiousquirk
Posts: 9
Joined: 25 Jan 2018, 17:05
what is two(2) plus three(3) ?: 5

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

Post by copiousquirk » 29 Oct 2018, 14:07

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

User avatar
RussH
Site Admin
Posts: 813
Joined: 12 Apr 2008, 08:28
what is two(2) plus three(3) ?: 5
Location: UK
Contact:

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

Post by RussH » 29 Oct 2018, 15:27

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.
RussH

Report your issues and feature requests;
https://github.com/opencats/opencats/issues

Please CLICK THE TICK to accept the answer!

copiousquirk
Posts: 9
Joined: 25 Jan 2018, 17:05
what is two(2) plus three(3) ?: 5

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

Post by copiousquirk » 10 Nov 2018, 21:08

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.

User avatar
RussH
Site Admin
Posts: 813
Joined: 12 Apr 2008, 08:28
what is two(2) plus three(3) ?: 5
Location: UK
Contact:

Re: MySQL Query Failed: Lost connection to MySQL server during query  [SOLVED]

Post by RussH » 12 Nov 2018, 12:33

If you can edit php.ini then this is what you need; https://stackoverflow.com/questions/382 ... out-in-php
RussH

Report your issues and feature requests;
https://github.com/opencats/opencats/issues

Please CLICK THE TICK to accept the answer!

copiousquirk
Posts: 9
Joined: 25 Jan 2018, 17:05
what is two(2) plus three(3) ?: 5

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

Post by copiousquirk » 15 Nov 2018, 15:12

On Godaddy, I found it here incase anyone else has this problem

https://imgur.com/a/A9AxZpW

Post Reply