mysql_upgrade — check tables for MariaDB upgrade

Synopsis

mysql_upgrade [options]

Description

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.

Note

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.

Caution

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.

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 https://mariadb.com/kb/

Author

MariaDB Foundation (http://www.mariadb.org/).

Info

9 May 2017 MariaDB 10.3 MariaDB Database System