mariadb-upgrade & mysql_upgrade for MariaDB Community Server 10.4

Overview

The mysql_upgrade utility examines the data directory for incompatibilities with MariaDB Community Server 10.4. It performs tasks, such as:

  • Upgrades the system tables to support any new features.

  • Attempts to repair tables with incompatibilities.

Problems can sometimes occur during upgrades. When problems occur, you may need to restore the system from a backup or reload the data from its system of record. Prior to upgrading, it is recommended to perform a backup or ensure that the system of record is available.

MariaDB Community Server 10.4 also provides a symbolic link to the utility's new name (mariadb-upgrade).

mysql_upgrade Options for MariaDB Community Server 10.4

Option

Description

--basedir (-b)

Not used by mysql_upgrade. Only for backward compatibility.

--character-sets-dir

Not used by mysql_upgrade. Only for backward compatibility.

--check-if-upgrade-is-needed

Exits with status 0 if an upgrades is required, 1 otherwise.

--compress

Not used by mysql_upgrade. Only for backward compatibility.

--datadir (-d)

Not used by mysql_upgrade. Only for backward compatibility.

--debug (-#)

This is a non-debug version. Catch this and exit.

--debug-check

Check memory and open file usage at exit.

--debug-info (-T)

Print some debug info at exit.

--default-auth

Default authentication client-side plugin to use.

--default-character-set

Not used by mysql_upgrade. Only for backward compatibility.

--defaults-extra-file

Read this file after the global files are read.

--defaults-file

Only read default options from the given file #.

--defaults-group-suffix

Additionally read default groups with # appended as a suffix.

--force (-f)

Force execution of mysqlcheck even if mysql_upgrade has already been executed for the current version of MariaDB.

--help (-?)

Display this help message and exit.

--host (-h)

Connect to host.

--no-defaults

Don't read default options from any option file.

--password (-p)

Password to use when connecting to server. If password is not given, it's solicited on the tty.

--plugin-dir

Directory for client-side plugins.

--port (-P)

Port number to use for connection or 0 for default to, in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306).

--print-defaults

Print the program argument list and exit.

--protocol

The protocol to use for connection (tcp, socket, pipe).

--silent

Print less information

--socket (-S)

The socket file to use for connection.

--ssl

Enable SSL for connection (automatically enabled with other flags).

--ssl-ca

CA file in PEM format (check OpenSSL docs, implies --ssl).

--ssl-capath

CA directory (check OpenSSL docs, implies --ssl).

--ssl-cert

X509 cert in PEM format (implies --ssl).

--ssl-cipher

SSL cipher to use (implies --ssl).

--ssl-crl

Certificate revocation list (implies --ssl).

--ssl-crlpath

Certificate revocation list path (implies --ssl).

--ssl-key

X509 key in PEM format (implies --ssl).

--ssl-verify-server-cert

Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default.

--tls-version

TLS protocol version for secure connection.

--tmpdir (-t)

Directory for temporary files.

--upgrade-system-tables (-s)

Only upgrade the system tables in the mysql database. Tables in other databases are not checked or touched.

--user (-u)

User for login.

--verbose (-v)

Display more output about the process; Using it twice will print connection argument;Using it 3 times will print out all CHECK, RENAME and ALTER TABLE during the check phase;Using it 4 times (added in MariaDB 10.0.14) will also write out all mariadb-check commands used;Using it 5 times will print all the mariadb commands used and their results while running mysql_fix_privilege_tables script. (Defaults to on; use --skip-verbose to disable.)

--version (-V)

Output version information and exit.

--version-check (-k)

Run this program only if its 'server version' matches the version of the server to which it's connecting. Note: the 'server version' of the program is the version of the MariaDB server with which it was built/distributed. (Defaults to on; use --skip-version-check to disable.)

--write-binlog

All commands including those issued by mysqlcheck are written to the binary log.

To see options supported in other versions, see "mariadb-upgrade & mysql_upgrade Options by MariaDB Server Version".