user image

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? 


Rakshit Date : 2022-03-05

Best answers


Best answers


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

change user root privelige and password
Publish date: 2022-02-23 | Comments: 1

Tag: PHP & Mysql

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

Tag: PHP & Mysql

phpmyadmin manual installation gives following error
Publish date: 2022-07-11 | Comments: 6

Tag: PHP & Mysql

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

Tag: PHP & Mysql

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

Tag: PHP & Mysql

php difference between two times in hours
Publish date: 2022-02-25 | Comments: 2

Tag: PHP & Mysql

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

Tag: PHP & Mysql