Webmin 2.670 — DBD::MariaDB authentication fails with error 1045 while MariaDB CLI succeeds using the same credentials

Hello @Ilia, @Jamie,

I would like to report a persistent DBI authentication issue on my production server, which I previously encountered in January 2026.

This is related to my earlier report about DBD::MariaDB detection:

The driver detection issue appears to have been addressed, but the actual DBI connection still fails.

Environment

  • OS: Rocky Linux 9.8
  • Webmin: 2.670
  • Virtualmin Pro: 8.3.0
  • MariaDB: 10.11.19
  • Perl DBI: 1.643
  • DBD::MariaDB: 1.24 (local installation)
  • DBD::MariaDB: 1.21 (Rocky Linux AppStream RPM)
  • Client library: libmariadb.so.3
  • Authentication: root@localhost / mysql_native_password

Problem

When I enable Use DBI to connect if available in Webmin’s MariaDB module, the connection fails:

DBI connect failed:
Access denied for user 'root'@'localhost'
(using password: YES)

Disabling DBI (nodbi=1) restores normal functionality.

Diagnostics performed

I verified the following using the global MariaDB credentials already stored in Webmin, without displaying or changing the password:

MariaDB CLI with explicit Unix socket: PASS
DBD::MariaDB 1.24 authentication: FAILED (1045)
DBD::MariaDB 1.21 authentication: FAILED (1045)
DBI with explicit Unix socket: FAILED (1045)

The CLI successfully executes SELECT 1 using the same stored credentials.

The Perl tests also reproduce the authentication failure outside the Webmin UI, using the same DBI driver connection approach.

Both installed DBD::MariaDB versions were tested separately, with their corresponding Perl module and XS library paths verified.

Additional findings:

  • No relevant per-user MySQL module ACL override was found.
  • The MariaDB account uses mysql_native_password.
  • The server socket is /var/lib/mysql/mysql.sock.
  • The RPM package integrity verification reported no differences.
  • No MariaDB passwords, users or authentication plugins were modified.

The same Webmin DBI authentication error occurred in January 2026 with Webmin 2.620.

Current status

I have restored and verified the working configuration with nodbi=1.

I am not proposing any changes to the production authentication configuration until the cause is established.

Questions

  1. Is this a known issue involving Webmin’s DBI connection path, DBD::MariaDB or MariaDB Connector/C?
  2. Are there any specific, safe diagnostics you recommend to identify why the CLI succeeds while both DBD::MariaDB versions fail?
  3. Is there an existing upstream fix or planned change that may address this behavior?

I can provide additional sanitized diagnostic results if needed.

Thank you!

Could you post the contents of the /etc/webmin/mysql/config file from your system? I’d like to see how it is configured to connect, specifically the host option.

Hi @Jamie,

Thanks for looking into this.

I checked /etc/webmin/mysql/config. The relevant connection settings are:

host=
port=
sock=
nodbi=1

All three connection target fields are explicitly empty. DBI is currently disabled as the working fallback.

For comparison, the MariaDB CLI successfully authenticates with the stored Webmin credentials when using:

--no-defaults
--protocol=socket
--socket=/var/lib/mysql/mysql.sock

However, isolated DBI authentication tests using an explicit Unix socket still return error 1045 with both DBD::MariaDB 1.21 and 1.24.

I haven’t changed any credentials or authentication configuration.

Could the empty host/socket settings cause Webmin’s DBI connection path to select different connection defaults from the CLI? Is there a specific read-only diagnostic you’d recommend to verify the effective DBI connection parameters?

I’ve omitted the login and pass fields and other unrelated configuration values for security reasons. I can provide additional sanitized settings if needed.

Thanks!

The issue may be that the DBI library and the mysql command use different default socket paths. Try adding the line sock=/var/lib/mysql/mysql.sock to /etc/webmin/mysql/config