Virtualmin does not create DB permissions in remote mysql

Debian 11
Webmin 2.201
Virtualmin 7.10.0

Hello everyone. From last webmin and virtualmin upgrades whenever I create a new domain or a new database for an existent domain, virtualmin create the new mysql database and the mysql user but it does not create the DB entry for grant access on the new database to the new mysql user.

The mysql server is remote and I can create the grant access from webmin → servers → mariadb database server.

Thank you.

Hello,

Does this issue still happen in the latest Virtualmin 7.20.2?

is this related?

Hello Illa,

I have installed

https://download.webmin.com/download/virtualmin/virtual-server-7.20.2.gpl.wbm.gz

but in webmin it shows 7.20.1 version.

Anyway, it fails yet.

Thank you.

Hello shoulders,

not the same issue. In my case virtualmin creates the default database and database user but it does not assign any privileges to the user over the database.

Thank you.

Do not install from a wbm package when you’re running a system with a good package manager. Install everything using apt/dpkg. (And, hopefully, when you originally installed you used our install script, rather than doing it manually…if you didn’t use the install script, you have many, many, things that will broken or configured incorrectly for virtual hosting. It would take many hours to fix a system not installed using the install script.)

That said, the version problem was just an oversight on Ilia’s part when he tagged the release.

1 Like

I noticed it the very first day. However, I didn’t say anything because it was never an issue in the packages you built for software.virtualmin.com.

Hello Joe,

I have had using virtualmin from wbm package in hundreds of servers from more than fifteen years ago with no problem at all.

Thank you.

Hello shoulders,

sorry because your was correct, I missunderstood the thread because the question was

“My server template is set so that when I create a new Virtual server there is no default database created.”

but later he wrote

" When I created a database manually the permissions are not set to all. in fact only Grant privileges are not granted."

so. No more automatic grant privileges on new databases creation in virtualmin? must the user grant these privileges manually? is it correct?

so. No more automatic grant privileges on new databases creation in virtualmin? must the user grant these privileges manually? is it correct?

I am not a Database expert but I think you are correct. This change was made to remove Grant privileges by default and if you want this you need to add it manually.

Hello again shouders and thank you for your time.

I`m re-reading the post but I think that is not the same issue. This change only reject the Grant privileges to the user so the user can’t re grant privileges. In my case, the user has no privileges at all on the database, it can do anything over the database.

Thank you.

No. That is incorrect.

If you create the data in Virtualmin, as part of a virtual server, it will have reasonable permissions (maybe not the permissions you want, but the same permissions they would have had if it’d been created at the same time as the domain).

Sounds like you created the database in the Webmin MySQL/MariaDB module.

But, “remote mysql” is in your title…and, you’d never have remote access to a database in Virtualmin by default. That would be something you’d have to configure explicitly.

Hello Joe,

sorry I didn´t answered before.

I have a webmin server and a remote mysql server, webmin can work with the remote mysql server from “Webmin → Servers → Mariadb database server” with no problem.

Until last upgrades some months ago, I created new domains or new databases in existing domains from virtualmin with no problem.
From some months ago, I can create new domains from virtualmin and the database and the database user are created with no problem but the grant privileges are not created. Same with new databases in existings domains.

It has happening in a few servers with the same configuration (webmin → mysql)

I wonder if you could check again after applying the following patch to your system and see if it resolves the issue:

webmin patch https://github.com/virtualmin/virtualmin-gpl/commit/4e797fa

Virtualmin 7.20.0+ intentionally doesn’t provide GRANT permissions to new users.

However, this shouldn’t impact your connection to the remote database, as you are expected to connect as the root user.

Hello Ilia,

I know, I saw the changelog but virtualmin does not creates any privilege, no read, no write, nothing at all so I have to grant this privileges manually.

I`m going to apply the patch and try again.

Thank you.

Hello Ilia,

the path don’t work.

webmin version: 2.201

patch applied succesfully:

$ sudo /usr/bin/webmin patch MySQL 8+ should also use create user https://forum.virtualmin.com/t/c… · virtualmin/virtualmin-gpl@4e797fa · GitHub
Patch applied successfully to:
feature-mysql.pl

Virtualmin version: 7.20.1 (Really is 7.20.2 but it has an issue with minor version)

From virtualmin:

Create new domain.
When finished: I go to webmin → servers → mariadb database server → users permissions and it exists the user, the database exist too

but in webmin → servers → mariadb database server → database permissions are not an entry for new user - database relationship.

Thank you.

Unfortunately, I can’t reproduce the issue. I tried creating a new database with a remote server, but everything worked as expected, and all database permissions were applied as expected:

To be clear, I ran a test from Ubuntu 24.04 with MariaDB to Rocky 9 with MySQL.

Did you do the same, and the database permissions weren’t created, right? If so, could you provide a screenshot from the host system where you added the new database, as well as from the remote system where the database server is located?

* Note that the permissions display differently in the screenshot above. It’s a new feature I added yesterday. You should see a long list of available permissions for now.

Hello Illa and thank you very much for your time.

My webmin server is debian 11.7 and the mysql server is debian 11.7 too.

“Did you do the same, and the database permissions weren’t created, right?” Right, that’s it.

I’m not sure what I could send to you. Anyway:

This is the webmin.log creation proccess:
1723642017.145002.0 [14/Aug/2024 15:26:57] soporte 91d9aec6f41b518e01dbd57d51bc957a XXX.XXX.230.2 virtual-server domain_setup.cgi “create” “domain” “prueba.es” alias=‘’ alias_mode=‘0’ aliasdomslimit=‘’ aliaslimit=‘’ aliasmail=‘’ allowedscripts=‘’ auto_letsencrypt=‘0’ bw_limit=‘’ cgi_bin_dir=‘cgi-bin’ cgi_bin_path=‘/home/prueba/cgi-bin’ created=‘1723642010’ creator=‘soporte’ db=‘prueba’ db_mysql=‘prueba’ db_postgres=‘’ dbslimit=‘’ defip=‘1’ dir=‘1’ dns=‘0’ dns_ip=‘’ dom=‘prueba.es’ domslimit=‘’ edit_admins=‘0’ edit_aliases=‘1’ edit_allowedhosts=‘0’ edit_backup=‘0’ edit_catchall=‘0’ edit_dbs=‘0’ edit_delete=‘0’ edit_disable=‘0’ edit_dnsip=‘0’ edit_domain=‘0’ edit_forward=‘0’ edit_ip=‘0’ edit_mail=‘0’ edit_passwd=‘1’ edit_phpmode=‘0’ edit_phpver=‘0’ edit_records=‘0’ edit_redirect=‘0’ edit_restore=‘0’ edit_sched=‘0’ edit_scripts=‘0’ edit_sharedips=‘0’ edit_spam=‘0’ edit_spf=‘0’ edit_ssl=‘0’ edit_users=‘1’ email=‘’ emailto=‘prueba@pro-web2.testdomain’ emailto_addr=‘prueba@pro-web2.testdomain’ emailto_src=‘prueba@pro-web2.testdomain’ forceunder=‘0’ ftp=‘0’ gid=‘1072’ group=‘prueba’ hashpass=‘0’ home=‘/home/prueba’ id=‘1723642009145002’ ip=‘XXX.XXX.231.139’ ip6=‘’ ipfollow=‘’ last_cgimode=‘suexec’ lastread_time=‘1723642017’ lastsave=‘1723642017’ lastsave_pid=‘145002’ lastsave_script=‘/virtual-server/domain_setup.cgi’ lastsave_type=‘web’ lastsave_user=‘soporte’ lastsave_webmincron=‘’ limit_dir=‘1’ limit_dns=‘0’ limit_ftp=‘0’ limit_logrotate=‘1’ limit_mail=‘0’ limit_mysql=‘1’ limit_postgres=‘0’ limit_spam=‘0’ limit_ssl=‘0’ limit_unix=‘1’ limit_virt=‘0’ limit_virtualmin-awstats=‘0’ limit_virus=‘0’ limit_web=‘1’ limit_webalizer=‘0’ limit_webmin=‘0’ logrotate=‘1’ mail=‘0’ mailboxlimit=‘’ migrate=‘’ mongrelslimit=‘’ mysql=‘1’ mysql_module=‘mysql’ mysql_user=‘prueba’ name=‘1’ name6=‘1’ netmask=‘’ netmask6=‘’ nodbname=‘0’ norename=‘’ owner=‘prueba’ parent=‘’ pass=‘KVMA%27e8cH5vR&7!GhT&4fF’ php_error_log=‘/home/prueba/logs/php_log’ php_mode=‘fcgid’ plan=‘0’ postgres=‘0’ prefix=‘prueba’ proxy_pass=‘’ proxy_pass_mode=‘0’ public_html_dir=‘public_html’ public_html_path=‘/home/prueba/public_html’ quota=‘1048576’ realdomslimit='’ reseller=‘’ safeunder=‘’ smtp_cloud=‘’ source=‘domain_setup.cgi’ spam=‘0’ ssl=‘0’ subdom=‘’ subprefix=‘’ template=‘0’ ugid=‘1072’ ugroup=‘prueba’ uid=‘1159’ unix=‘1’ uquota=‘1048576’ user=‘prueba’ virt=‘0’ virt6=‘’ virt6already=‘’ virtalready=‘0’ virtualmin-awstats=‘0’ virus=‘0’ web=‘1’ web_port=‘80’ web_urlport=‘’ webalizer=‘0’ webmin=‘0’

This is the out in the webmin http interface relative to database:
Creating MariaDB login …
… done

Creating MariaDB database prueba …
… done

and in the mysql server I got the database:
MariaDB [mysql]> show databases like ‘%prueba%’;
±--------------------+
| Database (%prueba%) |
±--------------------+
| prueba |
±--------------------+
1 row in set (0,001 sec)

The mysql users:
MariaDB [mysql]> select * from user where user like ‘%prueba%’;
±----------------±-------±------------------------------------------±------------±------------±------------±------------±------------±----------±------------±--------------±---->
| Host | User | Password | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Proc>
±----------------±-------±------------------------------------------±------------±------------±------------±------------±------------±----------±------------±--------------±---->
| 172.16.20.254 | prueba | *2F8E7EA07018E223493FFE058425006C3F8D67D8 | N | N | N | N | N | N | N | N | N >
| XXX.XXX.230.139 | prueba | *2F8E7EA07018E223493FFE058425006C3F8D67D8 | N | N | N | N | N | N | N | N | N >
±----------------±-------±------------------------------------------±------------±------------±------------±------------±------------±----------±------------±--------------±---->
2 rows in set (0,005 sec)

But nothing in DB table:
MariaDB [mysql]> select * from db where user like ‘%prueba%’;
Empty set (0,001 sec)

An older domain created show:

MariaDB [mysql]> select * from db where user like ‘%manueles%’;
±-----------------------±---------±---------±------------±------------±------------±------------±------------±----------±-----------±----------------±-----------±-----------±->
| Host | Db | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | C>
±-----------------------±---------±---------±------------±------------±------------±------------±------------±----------±-----------±----------------±-----------±-----------±->
| 172.16.20.254 | losmanueles | losmanueles | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y >
| XXX.XXX.231.139 | losmanueles | losmanueles | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y >
| pro-web2. | losmanueles | losmanueles | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y >
±-----------------------±---------±---------±------------±------------±------------±------------±------------±----------±-----------±----------------±-----------±-----------±->
3 rows in set (0,002 sec)

Hope no flood and no putting sensible info.

I’m gonna try to create from virtualmin cli, maybe some more info or using strace maybe could get some failed syscall.

No it won’t be it will the version that debian 11.7 installs this may vary on the versions that are held in debain’s repositories most likely mariadb 10.x or mysql 8.x