MARIADB-UPGRADE(1)

✨ MARIADB-UPGRADE ✨

okay bestie so this is the mariadb-upgrade page from the MariaDB Database System manual, and it's literally your post-upgrade glow-up ritual πŸ’…


🌸 NAME 🌸

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


πŸ¦‹ SYNOPSIS πŸ¦‹

mariadb-upgrade [options]

πŸ’– DESCRIPTION πŸ’–

so mariadb-upgrade goes through every single table in every single database and vibe-checks them for incompatibilities with the current version of the MariaDB Server. not only that, it also upgrades the system tables so you can actually take advantage of the new privileges or capabilities that might've been added. it's giving spring cleaning for your server 🧹✨

you should run mariadb-upgrade EVERY time you upgrade MariaDB. no skipping, bestie, fr fr.

if a table turns out to have a possible incompatibility, mariadb-upgrade performs a table check on it. and if problems show up? it attempts a table repair. it's got your back 🫢

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. like, it will simply not work, no cap 😭
Caution ⚠️ You should always back up your current MariaDB installation before performing an upgrade. this is not a drill, back it up first, periodt πŸ’€

to use mariadb-upgrade, make sure 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 actually take effect. the changes need a lil refresh moment, iykyk ✨

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, bestie, listen up:

  • 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. so yeah, maybe don't do this at peak hours πŸ™ˆ
  • 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 get marked with the current MariaDB version number. this is so that next time you run mariadb-upgrade with the same version of the server, it can tell whether there's any need to check or repair the table again. efficient queen πŸ‘‘

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. so if you wanna be stubborn about it, --force is right there πŸ’…

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. they're a package deal, literally 🀝

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.


πŸŽ€ OPTIONS πŸŽ€

  • --help, -? β€” Display a short help message and exit. your lil SOS button πŸ†˜
  • --basedir=path β€” Old option accepted for backward compatibility but ignored. it's just vibing there, doing nothing πŸ™ƒ
  • --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. (yes, it's backwards from what your brain expects, we don't make the rules 🀑)
  • --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. please bestie, use the option file 😭
  • --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. quiet luxury ✨
  • --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. minimal effort, maximal boundaries πŸ’…
  • --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. the more you stack it the more it yaps πŸ—£οΈπŸ”₯
  • --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.

Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2025 MariaDB Foundation

This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see http://www.gnu.org/licenses/.


🌈 SEE ALSO 🌈

For more information, please refer to the MariaDB Documentation, available online at https://mariadb.com/docs/


πŸ’œ AUTHOR πŸ’œ

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


and that's the whole page, bestie!! this was MariaDB 11.8, dated 5 March 2025, straight from the MARIADB-UPGRADE(1) corner of the universe πŸ¦‹ go forth and upgrade responsibly, back up first, and hydrate πŸ’–βœ¨

πŸ“¦ where this page comes from