Submitted by janderk on Sun, 10/06/2019 - 14:49
Noticed that when deleting a virtual server on debian 9 the MySQL database was not dropped. I had to do that manually.
Status:
Active
Noticed that when deleting a virtual server on debian 9 the MySQL database was not dropped. I had to do that manually.
Comments
Submitted by andreychek on Sun, 10/06/2019 - 19:37 Comment #1
Howdy -- thanks for your report!
Are you seeing that issue with other domains and databases? Or is it just this one?
I unfortunately wasn't able to reproduce an issue with that.
I'm passing this along to Jamie for further comment, he may have some additional troubleshooting ideas.
Submitted by JamieCameron on Sun, 10/06/2019 - 22:45 Comment #2
Did you get any error messages when deleting the domain?
Also, which MySQL version are you running there?
Submitted by janderk on Mon, 10/07/2019 - 02:36 Comment #3
I'm not home but have an idea what may have caused it. Will get back to you later, with hopefully steps to reproduce.
Submitted by janderk on Mon, 10/07/2019 - 13:38 Comment #4
OK I can reproduce the problem with a debian 8 backup containing 1 virtual server with only an empty MySQL database and the virtualmin config.
Restoring this backup in debian 9 and then deleting the virtual server leaves the database. No idea why. I see no error messages. Maybe an MySQL to MariaDB issue.
The backup file is 2KB. Let me know if you want me to mail or send it to you.
Submitted by JamieCameron on Tue, 10/08/2019 - 21:59 Comment #5
Also, which exact MySQL version are you running there?
Submitted by janderk on Wed, 10/09/2019 - 13:59 Comment #6
OK I figured it out. The virtualmin backup file, which triggered this problem, contained a virtual server with MySQL feature enabled but no mySQL content. The domain.com_mysql_domain.gz file was missing i the domain.com.tar.gz file.
Maybe this could have happened if the database was deleted manually. Anyway when restoring such a backup file a MySQL database is created, but when deleting this virtual server without MySQL content the database is not remove. I guess the restore looks at the enabled MySQL feature and the virtual server delete looks if there is an actual database.
It looks like a rather obscure condition, so fully understand it if you just let it go.