MySQL database not dropped when deleting a virtual server

Noticed that when deleting a virtual server on debian 9 the MySQL database was not dropped. I had to do that manually.

Status: 
Active

Comments

Assigned: Unassigned ยป

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.

Did you get any error messages when deleting the domain?

Also, which MySQL version are you running there?

I'm not home but have an idea what may have caused it. Will get back to you later, with hopefully steps to reproduce.

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.

Also, which exact MySQL version are you running there?

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.