MariaDB Database Server: Error when I try to create a new user

Hello,

I am using Webmin 2.301 on a Debian Linux 11 Server. MariaDB version is 10.5.26

Since a few weeks, I always get the following error, when I try to create a new user (Username, Password and Permissions) in the MariaDB Database Server → User Permissions.

Failed to save user : SQL grant 1 on . to ‘Testuser’@‘%’ failed : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘1 on . to ‘Testuser’@’%‘’ at line 1

That is weird, look like a viable is not being added. Normal it should be @‘localhost’

Without know of the history of what you previously done on the machine it hard to know.

Thanks for the reply.

I can only say that I last successfully created a user with permissions in the same way on January 30, 2025.

And if I do exactly the same today:

  • If I only specify the username, password, and hosts, the user is created without any errors.
  • As soon as I specify even just one permission, I get this error message. The user is still created, but with permissions set to None. (It also seems to me, that the order of the permissions - dropdown list has changed for some entries)

I have not changed any webmin oder mariadb settings since that time. I have installed the webmin updates to 2.3 / 2.31 in February.

I also have Debian 11 and just tried this:

Username (*) Testuser
Password (*) Set to… **********
Hosts (*) Any
Permissions: Select, Insert, Update, Delete
Maximum (*) Unlimited
Require certificate type [None]

  • clicked on the Create button

New “Testuser” was created, no issues.

My Webmin install was part of Virtualmin.

  • Webmin version 2.202
  • Usermin version 2.102
  • Virtualmin version 7.30.4 Pro
  • Authentic theme version 21.20.7
  • MariaDB version 10.5.26

I suspect that this might have come with
Webmin 2.300 and Usermin 2.200 released (February 14, 2025).
At least something was changed in that module (and the permissions list is now sorted differently than before):
“Fix to improve how permissions are displayed in MySQL/MariaDB module.”

As I said, at the end of January with Webmin 2.202, I didn’t have these issues yet…

@MJH75 Thanks for the heads up!

This is indeed a bug and a regression! I have reverted the incorrect cleanup. You can apply the following patch to address the issue:

webmin patch https://github.com/webmin/webmin/commit/a125de4
3 Likes

Thanks, it’s working again :+1:.

2 Likes

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.