Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does my sql query continue executing after i been disconnected due to long operation?

If I run a SQL query in MySQL workbench and the connections time out after 30 seconds because it is taking a long time. Does my Query continue executing on the MySQL server even though I am disconnected?

For example, if I am doing an update and the update loops over a billion records. Does the MySQL server disconnect me first then it finishes the query after? Or does it disconnect me and terminate the query?

like image 732
Mustafa Avatar asked Oct 27 '25 09:10

Mustafa


1 Answers

Yes, MySQL Workbench can disconnect and the query keeps running. This has been reported as a bug, but it's in the "Verified" state, which means it is not fixed: https://bugs.mysql.com/bug.php?id=78809

See also this related SO thread: MySQL Query running even after losing connection

If you have a long-running query that needs to do a bulk update, you may need to change the MySQL Session timeout options in the MySQL Workbench preferences. Alternatively, don't use MySQL Workbench for long-running jobs, use the mysql command line tool.

like image 53
Bill Karwin Avatar answered Oct 28 '25 22:10

Bill Karwin