I found that as long as a connection is established to a certain database and a statement is executed, the database's files are occupied by MySQL. I cannot delete or compress the database file. Besides restarting the MySQL service, is there any other way to release MySQL's lock on the files? I have confirmed that my code correctly handles the closing and disposing of connections and commands.
The language I am using is C#, the library is MySql.Data, and the MySQL version is 5.6.41.