mysql_upgrade - Man Page

check tables for MariaDB upgrade (mysql_upgrade is now a symlink to mariadb-upgrade)


mysql_upgrade [options]


mysql_upgrade examines all tables in all databases for incompatibilities with the current version of the MariaDB Server. mysql_upgrade also upgrades the system tables so that you can take advantage of new privileges or capabilities that might have been added.

mysql_upgrade should be executed each time you upgrade MariaDB.

If a table is found to have a possible incompatibility, mysql_upgrade performs a table check. If any problems are found, a table repair is attempted.


On Windows Server 2008 and Windows Vista, you must run mysql_upgrade with administrator privileges. You can do this by running a Command Prompt as Administrator and running the command. Failure to do so may result in the upgrade failing to execute correctly.


You should always back up your current MariaDB installation before performing an upgrade.

To use mysql_upgrade, make sure that the server is running, and then invoke it like this:

shell> mysql_upgrade [options]

After running mysql_upgrade, stop the server and restart it so that any changes made to the system tables take effect.

mysql_upgrade executes the following commands to check and repair tables and to upgrade the system tables:

mysqlcheck --all-databases --check-upgrade --auto-repair
mysql < fix_priv_tables
mysqlcheck --all-databases --check-upgrade --fix-db-names --fix-table-names

Notes about the preceding commands:

All checked and repaired tables are marked with the current MariaDB version number. This ensures that next time you run mysql_upgrade with the same version of the server, it can tell whether there is any need to check or repair the table again.

mysql_upgrade also saves the MariaDB version number in a file named mysql_upgrade_info in the data directory. This is used to quickly check whether all tables have been checked for this release so that table-checking can be skipped. To ignore this file and perform the check regardless, use the --force option.

For this reason, mysql_upgrade needs to be run as a user with write access to the data directory.

If you install MariaDB from RPM packages on Linux, you must install the server and client RPMs. mysql_upgrade is included in the server RPM but requires the client RPM because the latter includes mysqlcheck.

mysql_upgrade supports the following options, which can be specified on the command line or in the [mysql_upgrade] and [client] option file groups. Other options are passed to mysqlcheck. For example, it might be necessary to specify the --password[=password] option. mysql_upgrade also supports the options for processing option files.

See Also

For more information, please refer to the MariaDB Knowledge Base, available online at


MariaDB Foundation (

Referenced By

The man page mariadb-upgrade(1) is an alias of mysql_upgrade(1).

20 July 2020 MariaDB 10.11 MariaDB Database System