Sample Header Ad - 728x90

How to set MariaDB to automatically kill long-running SQL queries?

1 vote
2 answers
97 views
I created a test query to do some counting but five minutes of execution time is ridiculous! So I figured there must be a maximum execution time setting somewhere however the two things I found and tried failed: 1. max_execution_time = 2 2. max_statement_time = 2 I attempted to place these in all three sections in my my.ini settings file and restarted the MariaDB service on Windows to verify if it worked (it didn't). MariaDB states that it will stop all queries unlike MySQL that only stops SELECT queries. **How do I force MariaDB to terminate long-running SQL queries?** I want to define this in the my.ini setting file; I do *not* want to define this in the command line call. **Update 1:** This update to my registry based command works but I don't want to set this configuration in the command line, it belongs in the configuration file: "C:\MariaDB\bin\mysqld.exe" "--defaults-file=C:\MariaDB\data\my.ini" "--max_statement_time=4" "MariaDB"
Asked by John (769 rep)
Jul 11, 2025, 09:44 PM
Last activity: Jul 14, 2025, 02:15 AM