MariaDB suspicious Access denied during `debian-start` and then FATAL ERROR: Upgrade failed

On a seemingly working server you may encounter the following checking out the mysql status:

Jun 15 10:32:33 host systemd[1]: Starting MariaDB 10.3.39 database server...
Jun 15 10:32:34 host systemd[1]: Started MariaDB 10.3.39 database server.
Jun 15 10:32:34 host /etc/mysql/debian-start[15144]: Looking for 'mysql' as: /usr/bin/mysql
Jun 15 10:32:34 host /etc/mysql/debian-start[15144]: Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
Jun 15 10:32:34 host /etc/mysql/debian-start[15144]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Jun 15 10:32:34 host /etc/mysql/debian-start[15144]: FATAL ERROR: Upgrade failed
Jun 15 10:32:34 host debian-start[15153]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Correlating the time with actual actions, it becomes clear to you that this error happened on startup, as mentioned by the debian-start tag.

Next you decide to upgrade innodb_buffer_pool_size. Again you restart, and this time there is more verbose information:

Jun 15 10:32:33 host systemd[1]: Starting MariaDB 10.3.39 database server...
Jun 15 10:32:34 host systemd[1]: Started MariaDB 10.3.39 database server.
Jun 15 10:32:34 host /etc/mysql/debian-start[15144]: Looking for 'mysql' as: /usr/bin/mysql
Jun 15 10:32:34 host /etc/mysql/debian-start[15144]: Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
Jun 15 10:32:34 host /etc/mysql/debian-start[15144]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Jun 15 10:32:34 host /etc/mysql/debian-start[15144]: FATAL ERROR: Upgrade failed
Jun 15 10:32:34 host debian-start[15153]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Ouch! It seems Maria can’t upgrade herself. What next?

To be honest, I use AI to check, and it’s messy. Leave us a comment if you have any advice.

Let’s give this another go. Environment

Fresh Debian 12 with Virtualmin default installation.

On the box was 10.11.14. Follow these instructions to upgrade to 11.8:

mariadb -V
apt policy mariadb-server
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version="11.8"
apt update
apt policy mariadb-server
systemctl stop mariadb
service mariadb status
apt upgrade mariadb-server mariadb-client

Important: I did the diff between installed and package maintainers, and I definitely choose the package maintainers!

Then

service mariadb status

At this point it seems started. But then I get the dreaded “access denied”:

root@host3:~# service mariadb status
● mariadb.service - MariaDB 11.8.5 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; preset: enabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: active (running) since Wed 2025-11-19 22:38:37 SAST; 21s ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Process: 5390 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && echo _WSREP_START_POSITION=$VAR > /run/mysqld/wsrep-start-positi>
Process: 5470 ExecStartPost=/bin/rm -f /run/mysqld/wsrep-start-position /run/mysqld/wsrep-new-cluster (code=exited, status=0/SUCCESS)
Process: 5471 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
Main PID: 5445 (mariadbd)
Status: "Taking your SQL requests now..."
Tasks: 15 (limit: 7305)
Memory: 97.5M
CPU: 2.462s
CGroup: /system.slice/mariadb.service
└─5445 /usr/sbin/mariadbd

Nov 19 22:38:37 host3.fusion.org.za mariadbd[5445]: 2025-11-19 22:38:37 0 [Note] Server socket created on IP: '127.0.0.1', port: '3306'.
Nov 19 22:38:37 host3.fusion.org.za mariadbd[5445]: 2025-11-19 22:38:37 0 [Note] mariadbd: Event Scheduler: Loaded 0 events
Nov 19 22:38:37 host3.fusion.org.za mariadbd[5445]: 2025-11-19 22:38:37 0 [Note] /usr/sbin/mariadbd: ready for connections.
Nov 19 22:38:37 host3.fusion.org.za mariadbd[5445]: Version: '11.8.5-MariaDB-deb12' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
Nov 19 22:38:37 host3.fusion.org.za systemd[1]: Started mariadb.service - MariaDB 11.8.5 database server.
Nov 19 22:38:37 host3.fusion.org.za /etc/mysql/debian-start[5473]: Upgrading MariaDB tables if necessary.
Nov 19 22:38:37 host3.fusion.org.za mariadbd[5445]: 2025-11-19 22:38:37 3 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
Nov 19 22:38:37 host3.fusion.org.za /etc/mysql/debian-start[5482]: Checking for insecure root accounts.
Nov 19 22:38:37 host3.fusion.org.za mariadbd[5445]: 2025-11-19 22:38:37 4 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
Nov 19 22:38:37 host3.fusion.org.za debian-start[5485]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
root@host3:~# mariadb -V
mariadb from 11.8.5-MariaDB, client 15.2 for debian-linux-gnu (x86_64) using EditLine wrapper

 

This was the fix:

systemctl stop mariadb
runuser -u mysql -- mariadbd --skip-grant-tables --skip-networking --user=mysql &
mariadb
UPDATE mysql.global_priv SET priv = JSON_SET(priv, '$.plugin', 'unix_socket') WHERE User = 'root' AND Host = 'localhost';
FLUSH PRIVILEGES;
exit
pkill mariadb
service mariadb start
service mariadb status

Then Webmin didn’t work, so this was the “new” fix:

UPDATE mysql.global_priv
SET priv = JSON_SET(priv,
    '$.authentication_string', ''
)
WHERE User='root' AND Host='localhost';

MariaDB 11 tightened privilege logic.

If a root account has plugin=unix_socket and an existing password hash, the system can misinterpret auth logic and block the login.

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top