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.
Comments
Submitted by ADDISON74 on Thu, 01/02/2020 - 16:16 Comment #1
Submitted by JamieCameron on Thu, 01/02/2020 - 23:17 Comment #2
On which page in Virtualmin did you delete the database?
Submitted by ADDISON74 on Fri, 01/03/2020 - 04:51 Comment #3
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.
Submitted by JamieCameron on Sun, 01/05/2020 - 15:11 Comment #4
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.
Submitted by ADDISON74 on Sun, 01/05/2020 - 15:28 Comment #5
root@server:~# mysql -V
mysql Ver 15.1 Distrib 10.3.18-MariaDB, for debian-linux-gnu (x86_64) using readline 5.
Submitted by JamieCameron on Wed, 01/08/2020 - 00:43 Comment #6
What command are you using to check for the existence of grants to the deleted DB?
Submitted by ADDISON74 on Wed, 01/08/2020 - 02:53 Comment #7
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.
Submitted by JamieCameron on Thu, 01/09/2020 - 01:15 Comment #8
Ok, thanks - I'll try to re-produce this as well. Looking at the code, it's not clear why this would happen.