The message "needs to be upgraded using 'mysql_upgrade' tool" is displayed when mariadb starts

Solution Verified - Updated -

Issue

  • After performing backup → restore operation on mariadb database using Mariabackup, when starting the restored database, the following message prompting that the database needs to be upgraded appears in /var/log/messages:
Apr  8 01:32:53 localhost systemd[1]: Starting MariaDB 10.3 database server...
Apr  8 01:32:53 localhost mysql-prepare-db-dir[12345]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
Apr  8 01:32:53 localhost mysql-prepare-db-dir[12345]: If this is not the case, make sure the /var/lib/mysql is empty before running mysql-prepare-db-dir.
Apr  8 01:32:53 localhost mysqld[12346]: 2024-04-08  1:32:53 0 [Note] /usr/libexec/mysqld (mysqld 10.3.28-MariaDB) starting as process 20096 ...
Apr  8 01:32:53 localhost mysql-check-upgrade[12347]: The datadir located at /var/lib/mysql needs to be upgraded using 'mysql_upgrade' tool. This can be done using the following steps:

Environment

  • Red Hat Enterprise Linux 8
  • MariaDB

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content