# mariadb-upgrade

## NAME



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


## SYNOPSIS



    
           **mariadb-upgrade [**_options_**]**
    


## DESCRIPTION



           **mariadb-upgrade** examines all tables in all databases for
           incompatibilities with the current version of the MariaDB Server.
           **mariadb-upgrade** also upgrades the system tables so that you can
           take advantage of new privileges or capabilities that might have
           been added.
    
           **mariadb-upgrade** should be executed each time you upgrade MariaDB.
    
           If a table is found to have a possible incompatibility, **mariadb-**
           **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
               **mariadb-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 **mariadb-upgrade** , make sure that the server is running, and
           then invoke it like this:
    
               shell> **mariadb-upgrade [**_options_**]**
    
           After running **mariadb-upgrade** , stop the server and restart it so
           that any changes made to the system tables take effect.
    
           **mariadb-upgrade** executes the following commands to check and
           repair tables and to upgrade the system tables:
    
               mariadb-check --all-databases --check-upgrade --auto-repair
               mariadb < _fix_priv_tables_
               mariadb-check --all-databases --check-upgrade --fix-db-names --fix-table-names
    
           Notes about the preceding commands:
    
           •   Because **mariadb-upgrade** invokes **mariadb-check** with the
               **--all-databases** option, it processes all tables in all
               databases, which might take a long time to complete. Each
               table is locked and therefore unavailable to other sessions
               while it is being processed. Check and repair operations can
               be time-consuming, particularly for large tables.
    
           •   For details about what checks the **--check-upgrade** option
               entails, see the description of the FOR UPGRADE option of the
               CHECK TABLE statement.
    
           •   _fix_priv_tables_ represents a script generated internally by
               **mariadb-upgrade** that contains SQL statements to upgrade the
               tables in the mysql database.
    
           All checked and repaired tables are marked with the current
           MariaDB version number. This ensures that next time you run
           **mariadb-upgrade** with the same version of the server, it can tell
           whether there is any need to check or repair the table again.
    
           **mariadb-upgrade** also saves the MariaDB version number in a file
           named mariadb-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, **mariadb-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.  **mariadb-upgrade** is included
           in the server RPM but requires the client RPM because the latter
           includes **mariadb-check**.
    
           **mariadb-upgrade** supports the following options, which can be
           specified on the command line or in the [mariadb-upgrade] and
           [client] option file groups. Other options are passed to **mariadb-**
           **check**. For example, it might be necessary to specify the
           **--password[=**_password_**]** option.  **mariadb-upgrade** also supports the
           options for processing option files.
    
           •   **--help** , **-?**
    
               Display a short help message and exit.
    
           •   **--basedir=**_path_
    
               Old option accepted for backward compatibility but ignored.
    
           •   **--character-sets-dir=**_path_
    
               Old option accepted for backward compatibility but ignored.
    
           •   **--check-if-upgrade-is-needed**
    
               Exit with a status code indicating if an upgrade is needed.
               Returns 0 if upgrade needed or current version couldn't be
               determined, 1 when no action required.
    
           •   **--datadir=**_path_
    
               Old option accepted for backward compatibility but ignored.
    
           •   **--debug=**_path_ , **-#**_path_
    
               For debug builds, output debug log.
    
           •   **--debug-check**
    
               Print some debugging information when the program exits.
    
           •   **--debug-info** , **-T**
    
               Print debugging information and memory and CPU usage
               statistics when the program exits.
    
           •   **--default-character-set=**_name_
    
               Old option accepted for backward compatibility but ignored.
    
           •   **--force**
    
               Ignore the mariadb-upgrade_info file and force execution of
               **mariadb-check** even if **mariadb-upgrade** has already been
               executed for the current version of MariaDB.
    
           •   **--host**
    
               Connect to MariaDB on the given host.
    
           •   **--password[=**_password_**]** , **-p[**_password_**]**
    
               The password to use when connecting to the server. If you use
               the short option form (**-p**), you _cannot_ have a space between
               the option and the password. If you omit the _password_ value
               following the **--password** or **-p** option on the command line,
               **mariadb-upgrade** prompts for one.
    
               Specifying a password on the command line should be considered
               insecure. You can use an option file to avoid giving the
               password on the command line.
    
           •   **--port=**_port_num_ , **-P** _port_num_
    
               The TCP/IP port number to use for the connection.
    
           •   **--protocol={TCP|SOCKET|PIPE|MEMORY}**
    
               The connection protocol to use for connecting to the server.
               It is useful when the other connection parameters normally
               would cause a protocol to be used other than the one you want.
    
           •   **--silent**
    
               Print less information.
    
           •   **--socket=**_path_ , **-S** _path_
    
               For connections to localhost, the Unix socket file to use, or,
               on Windows, the name of the named pipe to use.
    
           •   **--ssl**
    
               Enable SSL for connection (automatically enabled with other
               flags). Disable with **--skip-ssl**.
    
           •   **--ssl-ca=**_name_
    
               CA file in PEM format (check OpenSSL docs, implies **--ssl**).
    
           •   **--ssl-capath=**_name_
    
               CA directory (check OpenSSL docs, implies **--ssl**).
    
           •   **--ssl-cert=**_name_
    
               X509 cert in PEM format (check OpenSSL docs, implies **--ssl**).
    
           •   **--ssl-cipher=**_name_
    
               SSL cipher to use (check OpenSSL docs, implies **--ssl**).
    
           •   **--ssl-key=**_name_
    
               X509 key in PEM format (check OpenSSL docs, implies **--ssl**).
    
           •   **--ssl-crl=**_name_
    
               Certificate revocation list (check OpenSSL docs, implies
               **--ssl**).
    
           •   **--ssl-crlpath=**_name_
    
               Certificate revocation list path (check OpenSSL docs, 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.
    
           •   **--tmpdir=**_path_ , **-t** _path_
    
               The path name of the directory to use for creating 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=**_user_name_ , **-u** _user_name_
    
               The MariaDB user name to use when connecting to the server and
               not using the current login.
    
           •   **--verbose**
    
               Display more output about the process. Using it twice will
               print connection arguments; using it 3 times will print out
               all CHECK, RENAME and ALTER TABLE commands used 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 mariadb-fix-privilege-tables script.
    
           •   **--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**
    
               Cause binary logging to be enabled while **mariadb-upgrade** runs.
    


* * *