user image

Shilpa
Published in : 2022-03-03

MySQL - Lost connection to MySQL server during query - Required a solution.

PHP & Mysql

I am running a stored procedure that is returning more than 7000 user's data fetching from 12 tables including left joins and inner joins.

Sometimes It fails and throws the below error. Sorry, I can't publish the query for that due to confidentiality.

Lost connection to MySQL server during query

My MySQL version is 8.0.24 & My workbench is failing while executing the store procedure.

call fetchUsersInfor();

What should I do to fix it? is it an issue on the database server or workbench? 

Comments

Rakshit Date : 2022-03-05

Best answers

34

Best answers

34

I think it is MySQL workbench's issue. Because of multiple request, it may block the ongoing query and stop the process, so your system CPU usage can be stay under control.

 

For windows:

Latest version of MySQL workbench (v8+) gives option to update such timeouts.

Go to Edit > Preference > click Sql editor > find for DBMS connection read time out: 600 (In seconds)

You need to update this seconds to 1200 or 1500 as per your choice and usage/work behavior of MySQL .

 

For Mac: 

Follow below option,

Preferences > SQL Editor > Go to MySQL Session > set connection read timeout interval 

Set it to 0. It will work!

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

PHP mail function goes to spam not inbox
Publish date: 2022-02-28 | Comments: 2

Tag: PHP & Mysql

[solved] #1273 - Unknown collation: 'utf8mb4_0900_ai_ci'
Publish date: 2022-01-09 | Comments: 1

Tag: PHP & Mysql

mysql service start not exist
Publish date: 2022-02-23 | Comments: 4

Tag: PHP & Mysql

SQL full languages table
Publish date: 2022-02-24 | Comments: 2

Tag: PHP & Mysql

Warning appears in Zend framework
Publish date: 2022-02-24 | Comments: 1

Tag: PHP & Mysql

[solved] Storage engine 'InnoDB' does not support system tables
Publish date: 2022-01-09 | Comments: 0

Tag: PHP & Mysql

How the image file have .php extension?
Publish date: 2022-03-01 | Comments: 2

Tag: PHP & Mysql