MariaDB will not start after upgrade

After running “zypper up” yesterday MariaDB will no longer start.

theber@localhost:~> sudo systemctl status mariadb
● mariadb.service - MariaDB database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
    Drop-In: /etc/systemd/system/mariadb.service.d
             └─migrated-from-my.cnf-settings.conf
     Active: failed (Result: exit-code) since Fri 2021-08-06 06:16:10 CEST; 2h 30min ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/

Aug 06 06:16:09 localhost.localdomain mysql-systemd-helper[5979]: Phase 3/7: Fixing views
Aug 06 06:16:09 localhost.localdomain mysql-systemd-helper[5979]: /usr/bin/mysqlcheck: Got error: 1102: Incorrect database name '#mysql50#.local' when selecting the database
Aug 06 06:16:09 localhost.localdomain mysql-systemd-helper[5979]: FATAL ERROR: Upgrade failed
Aug 06 06:16:09 localhost.localdomain mysql-systemd-helper[5942]: Upgrade failed
Aug 06 06:16:09 localhost.localdomain mysql-systemd-helper[5942]: Shutting down protected MySQL
Aug 06 06:16:10 localhost.localdomain mysql-systemd-helper[5942]: Final cleanup
Aug 06 06:16:10 localhost.localdomain mysql-systemd-helper[5942]: Something failed during upgrade, please check logs
Aug 06 06:16:10 localhost.localdomain systemd[1]: mariadb.service: Control process exited, code=exited, status=1/FAILURE
Aug 06 06:16:10 localhost.localdomain systemd[1]: mariadb.service: Failed with result 'exit-code'.
Aug 06 06:16:10 localhost.localdomain systemd[1]: Failed to start MariaDB database server.

YaST shows that the installed versions of mariadb and mariadb-client are both 10.5.11-3.3.1, but the installed version of MariaDB-common is version 10.5.10-1. Red text means orphaned package, I think. I suppose that this could be the problem?

When I checked https://software.opensuse.org, I saw that there is nothing at all listed for Leap 15.3.
I’m tempted to use the repository from MariaDB itself, which offers version 10.6, but I’d rather stick with vanilla Leap if possible.

Is there anything else I can do, besides wait for the next upgrade?

MariaDB-common is NOT an openSUSE package in the first place - this comes from the MariaDB repo so you must have had this in use at some point. You can zypper rm it.

Please post or pastebin;

ls -la /var/lib/mysql/

If you find a dot file there (for example; .local) - remove this file. Remember; make backups before you do anything.

Then run;

systemctl start mariadb

The error refers to additional non-standard files in /var/lib/mysql so that’s why I’m asking you to check this first.

@Miuku
You are right about the MariaDB-common file. I must have used the repository with 15.0, 15.1, or 15.2 for some reason.

First thing I did was to remove the .local folder (not file) from /var/lib/mysql, and restart. Then MariaDB started normally. (I left the MariaDB-common file for now, since things are working again.)

Thanks for your help!

You now still have an orphaned (what in this case means: not to be found in any of the configured repositories on your system) package. When you do not need it, remove it. You might again forget about it in a year or so and then again get confused ;).

BTW, ~/.local is indeed a “directory”, but in Unix (thus Linux), “directories” are also “files”.

Good idea. Thanks for the tip!