If you delete from Virtualmin interface the database with the name of the domain you should revoke the privileges manually

I created a new Virtual Server named mydomain.net. This server has enabled as feature MySQL in this way I got a database called mydomain.

1) Delete this database and check the privileges from terminal inside mysql prompt with this command: show grants for mydomain@localhost; Even you deleted the database its privileges are still there. I revoked them manually.

2) This is not happening when you create other databases having different names than "mydomain". Their privileges are revoked once you delete them.

3) I created again mydomain database then I deleted it. Checking its privileges their are still into the database.

As conclusion, if the database name is "mydomain" the privileges are not revoked like for the other databases. You have to revoke them manually.



On which page in Virtualmin did you delete the database?

To replicate this issue create a Virtual server then check the privileges for the user from mysql> prompt. Go to Virtualmin -> Edit Databases. You will see only one database with domain name. Select it and then delete it.

Go back to mysql> prompt and check again the privileges. In my case they are still there, not revoked after deleting the database. This was happening only for this database. If I create new databases and delete them the privileges will be revoked too. It is not a serious bug, but some residues remain after deleting the database created by default.

Which MySQL version are you running there? The way privileges are handled has changed in recent release, and Virtualmin may be doing the wrong thing.

root@server:~# mysql -V
mysql  Ver 15.1 Distrib 10.3.18-MariaDB, for debian-linux-gnu (x86_64) using readline 5.

What command are you using to check for the existence of grants to the deleted DB?

mysql > show grants for <vm_account>;

I will spend a little time on this using two scenarios. First from VM interface deleting then checking in Webmin and prompt. Second as VM user deleting/checking in prompt.

I will keep you informed.

Ok, thanks - I'll try to re-produce this as well. Looking at the code, it's not clear why this would happen.