Last answered:

10 Nov 2023

Posted on:

09 Nov 2023

0

Resolved: database connection is not available

sir i tried many times to run the employees_mod.sql file but it shows error dbms connection is not available and lost connection to mysql server during query after this error i also try to change my ' connection read  timeout' 30 to 0,180 in sql editor tab but it couldn't work and sql still showing that error how i can fix it

1 answers ( 1 marked as helpful)
Instructor
Posted on:

10 Nov 2023

1

Hi Dev!
Thanks for reaching out.


The error message "Lost connection to MySQL server during query" (Error 2013) typically indicates that a query took too long to execute, and the server timed out before it could finish. Here are some steps you can take to troubleshoot and fix the issue:

1) Increase Timeout Settings:

You've mentioned increasing the 'connection read timeout' but also check the wait_timeout and interactive_timeout settings on your MySQL server. These settings define how long the server waits before closing idle connections. You can increase these values in your MySQL configuration file (my.cnf or my.ini depending on your operating system).
2) Check Server Resources:

The server may be running out of resources (like memory or CPU). Check the server's resource usage during query execution to ensure it has enough capacity to handle the operations. If resources are running low, you might need to upgrade your server or optimize your queries to consume fewer resources.


Hope this helps.
Best,
Tsvetelin

Submit an answer