Hello!
I have installed Debian 12 and MariaDB version 10.11.3
I am not good in text mode so I install webmin, I setup password for mysql root and everything worked just fine!
After I decide that i need phpmyadmin
from the beginning i have some issues to make this installation, but finally phpmyadmin installed and tested.
So.. webmin is working!
phpmyadmin is working!
mysql -u user -p is working
but when i try
systemctl status mariadb
i got the following
root@server:~# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
root@server:~# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5958
Server version: 10.11.3-MariaDB-1 Debian 12
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
What is the output of those commands command ?
echo "SELECT count(*) FROM mysql.user WHERE user='root' and password='' and plugin in ('', 'mysql_native_password', 'mysql_old_password');" | $MYSQL --skip-column-names )
echo $?
root@server:~# bash /etc/mysql/debian-start
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
sleep 5
journalctl -b --no-pager | tail -n 20
Oct 03 08:14:11 server /etc/mysql/debian-start[168263]: Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
Oct 03 08:14:11 server /etc/mysql/debian-start[168263]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Oct 03 08:14:11 server /etc/mysql/debian-start[168263]: FATAL ERROR: Upgrade failed
Oct 03 08:14:11 server /etc/mysql/debian-start[168269]: Checking for insecure root accounts.
Oct 03 08:14:20 server kernel: [UFW BLOCK] IN=eth0 OUT= MAC=00:50:56:3d:91:f1:28:99:3a:4d:30:af:08:00 SRC=91.240.118.220 DST=serverIP LEN=40 TOS=0x00 PREC=0x00 TTL=247 ID=33625 PROTO=TCP SPT=43879 DPT=5020 WINDOW=1024 RES=0x00 SYN URGP=0
Oct 03 08:14:44 server kernel: [UFW BLOCK] IN=eth0 OUT= MAC=00:50:56:3d:91:f1:28:99:3a:4d:30:af:08:00 SRC=185.36.81.33 DST=serverIP LEN=40 TOS=0x00 PREC=0x00 TTL=246 ID=54321 PROTO=TCP SPT=50969 DPT=8081 WINDOW=65535 RES=0x00 SYN URGP=0
Oct 03 08:15:11 server kernel: [UFW BLOCK] IN=eth0 OUT= MAC=00:50:56:3d:91:f1:28:99:3a:4d:30:af:08:00 SRC=45.128.232.166 DST=serverIP LEN=40 TOS=0x00 PREC=0x00 TTL=245 ID=54321 PROTO=TCP SPT=53005 DPT=3128 WINDOW=65535 RES=0x00 SYN URGP=0
Oct 03 08:15:19 server kernel: [UFW BLOCK] IN=eth0 OUT= MAC=00:50:56:3d:91:f1:28:99:3a:4d:30:af:08:00 SRC=78.128.113.250 DST=serverIP LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=30709 PROTO=TCP SPT=56946 DPT=9396 WINDOW=1024 RES=0x00 SYN URGP=0
Oct 03 08:15:44 server kernel: [UFW BLOCK] IN=eth0 OUT= MAC=00:50:56:3d:91:f1:28:99:3a:4d:23:91:08:00 SRC=190.109.227.20 DST=serverIP LEN=40 TOS=0x00 PREC=0x00 TTL=56 ID=40300 PROTO=TCP SPT=41319 DPT=23 WINDOW=64311 RES=0x00 SYN URGP=0
Oct 03 08:16:01 server kernel: [UFW BLOCK] IN=eth0 OUT= MAC=00:50:56:3d:91:f1:28:99:3a:4d:23:91:08:00 SRC=213.136.77.9 DST=serverIP LEN=40 TOS=0x00 PREC=0x00 TTL=254 ID=49799 PROTO=TCP SPT=61234 DPT=5904 WINDOW=1024 RES=0x00 SYN URGP=0
Oct 03 08:16:19 server kernel: [UFW BLOCK] IN=eth0 OUT= MAC=00:50:56:3d:91:f1:28:99:3a:4d:30:af:08:00 SRC=162.243.129.38 DST=serverIP LEN=40 TOS=0x00 PREC=0x00 TTL=245 ID=54321 PROTO=TCP SPT=48518 DPT=5007 WINDOW=65535 RES=0x00 SYN URGP=0
Oct 03 08:16:38 server kernel: [UFW BLOCK] IN=eth0 OUT= MAC=00:50:56:3d:91:f1:28:99:3a:4d:30:af:08:00 SRC=213.136.77.9 DST=serverIP LEN=40 TOS=0x00 PREC=0x00 TTL=254 ID=436 PROTO=TCP SPT=61234 DPT=5903 WINDOW=1024 RES=0x00 SYN URGP=0
Oct 03 08:17:01 server CRON[168534]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Oct 03 08:17:01 server CRON[168535]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)
Oct 03 08:17:01 server CRON[168534]: pam_unix(cron:session): session closed for user root
Oct 03 08:17:04 server /etc/mysql/debian-start[168555]: Upgrading MySQL tables if necessary.
Oct 03 08:17:04 server /etc/mysql/debian-start[168559]: Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
Oct 03 08:17:04 server /etc/mysql/debian-start[168559]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Oct 03 08:17:04 server /etc/mysql/debian-start[168559]: FATAL ERROR: Upgrade failed
Oct 03 08:17:04 server /etc/mysql/debian-start[168564]: Checking for insecure root accounts.
The second command (assume from mysql) do nothing return
Therefore, the output of the first command is:
root@server:~# bash /etc/mysql/debian-start
Oct 03 08:17:04 server /etc/mysql/debian-start[168555]: Upgrading MySQL tables if necessary.
Oct 03 08:17:04 server /etc/mysql/debian-start[168559]: Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
Oct 03 08:17:04 server /etc/mysql/debian-start[168559]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Oct 03 08:17:04 server /etc/mysql/debian-start[168559]: FATAL ERROR: Upgrade failed
This is the error in the journal log that appears when mariadb is started. I suppose mysql root user cannot access to some database or same tables in mariadb (phpmyadmin database ?) when it tries to check for tables needing an upgrade at startup (if any).
This is the actual shell script that does the check for damaged tables at startup:
## Check for tables needing an upgrade.
# - Requires the server to be up.
# - Is supposed to run silently in background.
function upgrade_system_tables_if_necessary() {
set -e
set -u
logger -p daemon.info -i -t$0 "Upgrading MySQL tables if necessary."
# Filter all "duplicate column", "duplicate key" and "unknown column"
# errors as the script is designed to be idempotent.
LC_ALL=C $MYUPGRADE \
2>&1 \
| egrep -v '^(1|@had|ERROR (1051|1054|1060|1061|1146|1347|1348))' \
| logger -p daemon.warn -i -t$0
## Check for the presence of both, root accounts with and without password.
# This might have been caused by a bug related to mysql_install_db (#418672).
function check_root_accounts() {
set -e
set -u
logger -p daemon.info -i -t$0 "Checking for insecure root accounts."
ret=$( echo "SELECT count(*) FROM mysql.user WHERE user='root' and password='' and plugin in ('', 'mysql_native_password', 'mysql_old_password');" | $MYSQL --skip-column-names )
if [ "$ret" -ne "0" ]; then
logger -p daemon.warn -i -t$0 "WARNING: mysql.user contains $ret root accounts without password!"
The message error is generated in the mysql_upgrade command here:
# /usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf --version-check
Looking for 'mariadb' as: /usr/bin/mariadb
Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
FATAL ERROR: Upgrade failed
Seems to me that must uninstall everything and reinstall
I'm happy you got sorted.
Please remember to mark the thread as solved, adding the textual tag [Solved] at the beginning of the subject of the first post.
Happy Debian ! :-)