MySQL Error (2006) - Server Timeout on DELETE Operation in Azure Database

Mingqi Cai 0 Reputation points
2025-09-02T06:15:26.35+00:00

I am encountering an issue with a DELETE operation in my MySQL database hosted on Azure. The query DELETE FROM recommend_tag_new is causing a timeout, and I receive the following error:

(pymysql.err.OperationalError) (2006, "MySQL server has gone away (TimeoutError(110, 'Connection timed out'))")

The error occurs at 1:30 AM (on 8/31/2025), and this is impacting the ability to delete records from the specified table. The query is failing with the following traceback:

[SQL: DELETE FROM recommend_tag_new]
Error: (pymysql.err.OperationalError) (2006, "MySQL server has gone away (TimeoutError(110, 'Connection timed out'))") 

As additional information,

the same issue previously discussed in the Microsoft Q&A thread: Microsoft Learn. This error, (pymysql.err.OperationalError) (2006, "MySQL server has gone away (TimeoutError(110, 'Connection timed out'))"), often arises during scheduled batch jobs in Azure Database for MariaDB.

And recently we had finished the migration from MariaDB to MySQL that we thought the migration could help us solve this issue but it didn't.

MySQL Timeout Settings:

SELECT @@wait_timeout, @@net_read_timeout, @@net_write_timeout, @@interactive_timeout;

# the result like:
wait_timeout = 28800
interactive_timeout = 28800
net_read_timeout = 120
net_write_timeout = 240

how often the error happened below:User's image

Azure Database for MySQL
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.