MariaDB syntax change on Rocky 10

SYSTEM INFORMATION
OS type and version Rocky Linux 10.1
Webmin version 2.640

Trying to add a MariaDB user using Webmin, results in this error message:

Failed to save user : SQL create user ‘xyz’@‘localhost’ identified with mysql_native_password by ‘xxxxxxxx’ 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 ‘by ‘xxxxxxxx’’ at line 1

  • Syntax Mismatch: MariaDB changed how it handles the IDENTIFIED clause. The IDENTIFIED WITH 'plugin' BY 'password' syntax is more common in standard MySQL, but MariaDB often expects IDENTIFIED VIA or simply IDENTIFIED BY.

  • Webmin Compatibility: It looks like Webmin is sending a legacy MySQL command that your current Rocky Linux MariaDB environment (likely 10.11 or newer) finds “deprecated” or syntactically incorrect.

[!TIP] Since you are on Rocky Linux 10, you are likely running a very recent version of MariaDB where the VIA keyword has replaced WITH for plugin declarations.

Can Webmin be updated to support the new syntax in MariaDB?

Thanks.

Another related issue:

Viewing the user named “root”, the Current hashed password field shows invalid. This happens because MariaDB 10.4+ moved user credentials from the mysql.user table to a more secure internal structure. Webmin is likely trying to read the old Password column, which is now blank or deprecated, causing it to display “invalid” even if your login actually works.

So there may be a number of differences in the latest MariaDB that Webmin is not aware of.

Which mariadb are you actually running? I run 10.11 on Alma 9.7 and it works fine.

I will upgrade to 11.8 when alma 9.8 has it in module stream.

I would assume Virtualmin can deal with 11.8

Webmin says I am running MariaDB version 10.11.15.
I don’t use Virtualmin, just Webmin.

What is the actual MariaDB version you are running?

select version();
±-----------------+
| version() |
±-----------------+
| 10.11.15-MariaDB |
±-----------------+

Same as Webmin reports. How could it be different?

What is the content of /etc/webmin/mysql/config file?

/etc/webmin/mysql/config

max_text=1000
max_dbs=50
ssl=0
mysqladmin=/usr/bin/mysqladmin
access=*: *
stop_cmd=systemctl stop mariadb
mysqlshow=/usr/bin/mysqlshow
add_mode=1
start_cmd=systemctl start mariadb
style=1
my_cnf=/etc/my.cnf
blob_mode=0
mysql=/usr/bin/mysql
webmin_subs=0
mysqldump=/usr/bin/mysqldump
date_subs=0
mysqlimport=/usr/bin/mysqlimport
login=root
nodbi=0
passwd_mode=0
mysql_data=/var/lib/mysql
nopwd=0
perpage=25
mysql_libs=

Got it, thanks for the heads-up.

I think I found the bug causing the issue on your end.

Try applying this patch and let me know if it works.

webmin patch https://github.com/webmin/webmin/commit/413087a

Sorry but I’m not clear on how to apply the patch. Just copy the mysql-lib.pl file over an existing file and restart Webmin? In GitHub I just “Download the raw file”?

Just run the command @Ilia posted in the previous post

Thanks. It isn’t obvious that is a command to be entered on a command line.

It is to ‘regular’ readers here. :wink:

Not everyone is here every day, and that’s fine.

There are several webmin commands, which you can see with:

[root@n1 ~]# webmin -l
disable-proxy
disable-twofactor
enable-proxy
language-manager
list-config
passwd
patch
server
set-config
update-devel

All have help.

[root@n1 ~]# webmin list-config --help
Usage:
    webmin list-config [options]

Options:
    --help, -h
        Print this usage summary and exit.

    --config, -c
        Specify the full path to the Webmin configuration directory.
        Defaults to "/etc/webmin"

    --module, -m
        Specify which module configuration to display. If none given,
        configuration will be assumed to be the Webmin core configuration
        (/etc/webmin/miniserv.conf).

    --option, -o
        Specify a single option to display. By default, the entire
        configuration file will be displayed. If this option is given, only
        the option specified will be shown.

    --describe, -d
        Display the description of the option from the module "config.info"
        file, instead of it's current value. This option is only available
        for modules, as miniserv.conf does not have a config.info.

Thank you very much for the information. I have been using Webmin for many years, currently on nine cloud servers and one local, but I have rarely needed to visit the forum so all of those options are new to me. I guess that is a testament to the stability and reliability of Webmin in my experience.

I don’t use git so first try resulted in this:

sudo webmin patch Fix MariaDB create user auth plugin syntax · webmin/webmin@413087a · GitHub
Neither “patch” nor “git” commands are installed

Strange and annoying that the text I pasted in is not displayed correctly, The blue text is not exactly the command I sent to my server or pasted in to this editor.

Installed git.

sudo webmin patch Fix MariaDB create user auth plugin syntax · webmin/webmin@413087a · GitHub
Patch applied successfully to:
mysql/mysql-lib.pl

Tested adding a user to MariaDB and it was successful with no error messages.

Thank you.