Problem with mariadb after update

In this testing update:

I had info:

:: MariaDB was updated to a new feature release. To update the data run:
   systemctl restart mariadb.service && mysql_upgrade -u root -p

So I did the command to update db and got:

Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

Then I checked:

[michaldybczak@alienware-PC ~]$ sudo systemctl status mariadb.service
● mariadb.service - MariaDB 10.3.12 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2019-01-20 09:34:14 CET; 21s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 5194 ExecStart=/usr/bin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
  Process: 5185 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && syst>
  Process: 5184 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
 Main PID: 5194 (code=exited, status=1/FAILURE)
   Status: "Starting final batch to recover 13 pages from redo log"

sty 20 09:34:14 alienware-PC mysqld[5194]: 2019-01-20  9:34:14 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
sty 20 09:34:14 alienware-PC mysqld[5194]: 2019-01-20  9:34:14 0 [Note] Recovering after a crash using tc.log
sty 20 09:34:14 alienware-PC mysqld[5194]: 2019-01-20  9:34:14 0 [Note] Starting crash recovery...
sty 20 09:34:14 alienware-PC mysqld[5194]: 2019-01-20  9:34:14 0 [Note] Crash recovery finished.
sty 20 09:34:14 alienware-PC mysqld[5194]: 2019-01-20  9:34:14 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't >
sty 20 09:34:14 alienware-PC mysqld[5194]: 2019-01-20  9:34:14 0 [Note] Server socket created on IP: '::'.
sty 20 09:34:14 alienware-PC mysqld[5194]: 2019-01-20  9:34:14 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user>
sty 20 09:34:14 alienware-PC systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
sty 20 09:34:14 alienware-PC systemd[1]: mariadb.service: Failed with result 'exit-code'.
sty 20 09:34:14 alienware-PC systemd[1]: Failed to start MariaDB 10.3.12 database server.

Now, I’m not sure if this specific update is at fault or if the issue existed earlier and I just didn’t notice. I don’t see any negative impact of this, although mariadb is a dependency for akonadi. I opened akonadi programs and they seem to run fine so I’m not sure if that is even important but I think it’s better to clear out all issues if possible.

Thanks

Unfortunately the error is cut off. But it looks like as if mariadb was never set up. This might be the case if mariadb was installed as a dependency. But never configured or started.
Mariadb needs to be manually set up before you can start it, otherwise it fails.

If you want to use mariadb try set it up before you start the service.
https://wiki.archlinux.org/index.php/MariaDB#Installation

Since you already started mariadb, you might need to remove files in /var/lib/mysql before you can set up mariadb.

3 Likes

Thanks. Yes, it was installed as dependency and I don’t know if I even need it. So it may not worked from the start and I just noticed it because of the update. Will see what I can do to set it up properly, assuming it is needed for some specific akonadi functionalities that I haven’t discovered yet.

EDIT: Thanks. That worked. I deleted files in /var/lib/mysql and then run:

# mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
# systemctl start mariadb.service

This started mariadb correctly. So at the end I did the secure configuration:

# mysql_secure_installation

I only wonder, if akonadi is going to use it, I have to set it up manually, so probably whatever functionality of akonadi needs it, it still won’t be accessible by default… But that’s a problem for another time.
Thanks!

1 Like

I’m not using KDE, but the Arch wiki list a config file for akonadi at ~/.config/akonadi/akonadiserverrc . But no mysql/mariadb example.

https://wiki.archlinux.org/index.php/KDE#Akonadi

If you want to run mariadb only for your system, I suggest you set skip-networking in the [mysqld] section.

But in the end it might be overkill to use mariadb for akonadi.

I have no idea what mariadb is doing on my system but the info shows that “it is required by akonadi” so I assume it was installed with the system or maybe with some akonadi update along the way. Anyway, not sure what fixing it is doing, but at least one less issue on the system :slight_smile: .

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.