Upgrading from MariaDB 10.1 to MariaDB 10.2

How to Upgrade

For Windows, see Upgrading MariaDB on Windows instead.

For MariaDB Galera Cluster, see Upgrading from MariaDB 10.1 to MariaDB 10.2 with Galera Cluster instead.

Before you upgrade, it would be best to take a backup of your database. This is always a good idea to do before an upgrade. We would recommend mariadb-backup.

The suggested upgrade procedure is:

  1. Modify the repository configuration, so the system's package manager installs MariaDB 10.2. For example,

  1. Set innodb_fast_shutdown to 0. It can be changed dynamically with SET GLOBAL. For example:SET GLOBAL innodb_fast_shutdown=0;

  • This step is not necessary when upgrading to MariaDB 10.2.5 or later. Omitting it can make the upgrade process far faster. See MDEV-12289 for more information.

  1. Uninstall the old version of MariaDB.

  • On Debian, Ubuntu, and other similar Linux distributions, execute the following:sudo apt-get remove mariadb-server

  • On RHEL, CentOS, Fedora, and other similar Linux distributions, execute the following:sudo yum remove MariaDB-server

  • On SLES, OpenSUSE, and other similar Linux distributions, execute the following:sudo zypper remove MariaDB-server

  1. Install the new version of MariaDB.

  1. Make any desired changes to configuration options in option files, such as my.cnf. This includes removing any options that are no longer supported.

  • mysql_upgrade does two things:

    1. Ensures that the system tables in the [mysq](../../../../reference/sql-statements-and-structure/sql-statements/administrative-sql-statements/system-tables/the-mysql-database-tables/README.md)l database are fully compatible with the new version.

    2. Does a very quick check of all tables and marks them as compatible with the new version of MariaDB .

Incompatible Changes Between 10.1 and 10.2

On most servers upgrading from 10.1 should be painless. However, there are some things that have changed which could affect an upgrade:

InnoDB Instead of XtraDB

MariaDB 10.2 uses InnoDB as the default storage engine, rather than XtraDB, used in MariaDB 10.1 and before. See Why does MariaDB 10.2 use InnoDB instead of XtraDB? In most cases this should have minimal effect as the latest InnoDB has incorporated most of the improvements made in earlier versions of XtraDB. Note that certain XtraDB system variables are now ignored (although they still exist so as to permit easy upgrading).

Options That Have Changed Default Values

In particular, take note of the changes to innodb_strict_mode, sql_mode, binlog_format, binlog_checksum and innodb_checksum_algorithm.

Options That Have Been Removed or Renamed

The following options should be removed or renamed if you use them in your option files:

Option
Reason

Option

Reason

aria_recover

Memcache never implemented in MariaDB.

Memcache never implemented in MariaDB.

Memcache never implemented in MariaDB.

Memcache never implemented in MariaDB.

[

innodb_api_trx_level](../../../../reference/storage-engines/innodb/innodb-system-variables.md)

Reserved Words

New reserved words: OVER, RECURSIVE and ROWS. These can no longer be used as identifiers without being quoted.

TokuDB

TokuDB has been split into a separate package, mariadb-plugin-tokudb.

Replication

Replication from legacy MySQL servers may require setting binlog_checksum to NONE.

SQL Mode

SQL_MODE has been changed; in particular, NOT NULL fields with no default will no longer fall back to a dummy value for inserts which do not specify a value for that field.

Auto_increment

Auto_increment columns are no longer permitted in CHECK constraints, DEFAULT value expressions and virtual columns. They were permitted in earlier versions, but did not work correctly.

TLS

Starting with MariaDB 10.2, when the user specifies the --ssl option with a client or utility, the client or utility will not verify the server certificate by default. In order to verify the server certificate, the user must specify the --ssl-verify-server-cert option to the client or utility. For more information, see the list of options for the mysql client.

Major New Features To Consider

You might consider using the following major new features in MariaDB 10.2:

See Also

This page is licensed: CC BY-SA / Gnu FDL

Last updated

Was this helpful?