In my case, I just ran into this issue after what turned out to be 2 unfortunate events.
I did a minor MariaDB upgrade, which restarted the server. Unfortunately, the server crashed during shutdown, and the upgrade script, which on OpenSUSE is
ExecStartPre=/usr/lib/mysql/mysql-systemd-helper upgrade tried to run
mysql_upgrade which in turn crashed because some of the tables were corrupted and Innodb recovery hasn't run yet. Because of this
ExecStartPre step failure, the start script never got to starting the actual Mariadb (
What I did to fix it:
- Start MariaDB directly, bypassing the upgrade step:
/usr/lib/mysql/mysql-systemd-helper start. The server started fine and performed a recovery step:
2023-05-22 11:41:25 0 [Note] mysqld: Aria engine: starting recovery
recovered pages: 0% 10% 20% 38% 50% 60% 70% 80% 90% 100% (0.0 seconds); tables to flush: 4 3 2 1 0
2023-05-22 11:41:25 0 [Note] mysqld: Aria engine: recovery done
At this point,
/usr/lib/mysql/mysql-systemd-helper upgrade complete OK and don't crash.
Done. I checked with
rcmysql restart and the server restarted OK. The issue is now solved.
I think the MariaDB/MySQL teams can definitely optimize for this case and try to trigger an automatic repair during upgrade if it's needed.
Hope this helps someone.