This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-16. For the latest, interactive version please visit https://mariadb.com/kb/.

MariaDB errors after OpenSUSE Leap update

I have an OpenSimulator virtual world that has been running on MariaDB and OpenSUSE (currently Leap 15.2) for ten years. MariaDB suddenly stopped running this morning after an OpenSUSE update. I’m stumped. I have users who need to log on, but the mariadb problem is preventing starting it. I really hope someone can help!

Last evening at 9pm I performed a ‘zypper update’. It didn’t return any errors. My crontab backup ran successfully at 2am. I waited until 3:30am to reboot the server so I wouldn’t knock any users off. I didn’t get any errors until I started mono to run my virtual world. Instead of starting, it gave me a long string of error messages. The log file contained:

Jun 17 03:33:13 virtualmarin mysql-systemd-helper[5047]: 2021-06-17  3:33:13 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 32190)
Jun 17 03:33:13 virtualmarin mysql-systemd-helper[5047]: 2021-06-17  3:33:13 0 [Warning] Changed limits: max_open_files: 1024  max_connections: 151 (was 151)  table_cache: 4>
Jun 17 03:33:16 virtualmarin systemd[1]: mariadb.service: Main process exited, code=exited, status=7/NOTRUNNING
Jun 17 03:33:16 virtualmarin systemd[1]: Failed to start MariaDB database server.

I fixed the max-open-files error by creating /etc/systemd/system/mariadb.service.d/limitnofile.conf, which contained:

[Service]
LimitNOFILE=1048576

But mariadb still failed, though with a different but unidentified error.

I’ve now uninstalled mariadb and reinstalled it, but after executing

systemctl enable mysql
systemctl start mysql

I get an entirely new set of errors:

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
           └─limitnofile.conf
   Active: failed (Result: exit-code) since Thu 2021-06-17 14:29:25 PDT; 23s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 4417 ExecStartPre=/usr/lib/mysql/mysql-systemd-helper install (code=exited, status=1/FAILURE)

Jun 17 14:29:25 virtualmarin mysql-systemd-helper[4417]: You can also try to start the mysqld daemon with:
Jun 17 14:29:25 virtualmarin mysql-systemd-helper[4417]:     shell> /usr/sbin/mysqld --skip-grant-tables --general-log &
Jun 17 14:29:25 virtualmarin mysql-systemd-helper[4417]: and use the command line tool /usr/bin/mysql
Jun 17 14:29:25 virtualmarin mysql-systemd-helper[4417]: to connect to the mysql database and look at the grant tables:
Jun 17 14:29:25 virtualmarin mysql-systemd-helper[4417]:     shell> /usr/bin/mysql -u root mysql
Jun 17 14:29:25 virtualmarin mysql-systemd-helper[4417]:     mysql> show tables;
Jun 17 14:29:25 virtualmarin systemd[1]: mariadb.service: Control process exited, code=exited status=1
Jun 17 14:29:25 virtualmarin systemd[1]: Failed to start MariaDB database server.
Jun 17 14:29:25 virtualmarin systemd[1]: mariadb.service: Unit entered failed state.
Jun 17 14:29:25 virtualmarin systemd[1]: mariadb.service: Failed with result 'exit-code'.

This system has been running for ten years. I didn’t make any changes yesterday or today (or recently, for that matter). All I did was run ‘zypper update’ and then reboot the system. I’m desperate. Can anyone make a suggestion?

Answer Answered by Erik Gordon Bainbridge in this comment.

In case it helps someone, here is how I solved the problem. This is on OpenSUSE Leap 15.2.

1. Renamed /var/lib/mysql and /etc/my.cnf to temporary names 2. Completely uninstalled mariadb 3. Created a file in /etc/systemd/system/mariadb.service.d to increase the open files limit and then reload the systemd manager configuration with the following code

tee /etc/systemd/system/mariadb.service.d/limitnofile.conf <<EOF
[Service]

LimitNOFILE=1048576
EOF
systemctl daemon-reload

4. Installed mariadb and mariadb-tools 5. Deleted /var/mysql and /etc/my.cnf created by mariadb and renamed my old ones to these names

My system is fine now. Renaming /var/lib/mysql and /etc/my.cnf were essential steps. I still don't know why an OpenSUSE update triggered the problem. I dudn't see comments about it in OpenSUSE forums, so there must have been something in my configuration that caused it, but I don't know what. I have a pretty standard installation.

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.