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 Mariabackup.

The suggested upgrade procedure is:

  1. Modify the repository configuration, so the system's package manager installs MariaDB 10.2. For example,
  2. 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.
  3. Stop MariaDB.
  4. 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
  5. Install the new version of MariaDB.
  6. Make any desired changes to configuration options in option files, such as my.cnf. This includes removing any options that are no longer supported.
  7. Start MariaDB.
  8. Run mysql_upgrade.
    • mysql_upgrade does two things:
      1. Ensures that the system tables in the mysql 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.

Option Old default value New default value
aria_recover(_options) NORMAL BACKUP, QUICK
binlog_annotate_row_events OFF ON
binlog_checksum NONE CRC32
binlog_format STATEMENT MIXED
group_concat_max_len 1024 1048576
innodb_autoinc_lock_mode 1 2
innodb_buffer_pool_dump_at_shutdown OFF ON
innodb_buffer_pool_dump_pct 100 25
innodb_buffer_pool_instances 8 Varies
innodb_buffer_pool_load_at_startup OFF ON
innodb_checksum_algorithm innodb crc32
innodb_file_format Antelope Barracuda
innodb_large_prefix OFF ON
innodb_lock_schedule_algorithm VATS FCFS
innodb_log_compressed_pages OFF ON
innodb_max_dirty_pages_pct_lwm 0.001000 0
innodb_max_undo_log_size 1073741824 10485760
innodb_purge_threads 1 4
innodb_strict_mode OFF ON
innodb_undo_directory . NULL
innodb_use_atomic_writes OFF ON
innodb_use_trim OFF ON
lock_wait_timeout 31536000 86400
log_slow_admin_statements OFF ON
log_slow_slave_statements OFF ON
log_warnings 1 2
max_allowed_packet 4M 16M
max_long_data_size 4M 16M
myisam_recover_options NORMAL BACKUP, QUICK
optimizer_switch See Optimizer Switch for details.
replicate_annotate_row_events OFF ON
server_id 0 1
slave_net_timeout 3600 60
sql_mode NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION STRICT_TRANS_TABLES, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION
thread_cache_size 0 Auto
thread_pool_max_threads 1000 65536
thread_stack 295936 299008

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
aria_recover Renamed to aria_recover_options to match myisam_recover_options.
innodb_additional_mem_pool_size Deprecated in MariaDB 10.0.
innodb_api_bk_commit_interval Memcache never implemented in MariaDB.
innodb_api_disable_rowlock Memcache never implemented in MariaDB.
innodb_api_enable_binlog Memcache never implemented in MariaDB.
innodb_api_enable_mdl Memcache never implemented in MariaDB.
|innodb_api_trx_level Memcache never implemented in MariaDB.
innodb_use_sys_malloc Deprecated in MariaDB 10.0.

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

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.

© 2021 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/upgrading-from-mariadb-101-to-mariadb-102/