MariaDB 10.5 Release Highlights for Administrators
I waited for 10.5.8 before touching production. 10.5 has been GA since 10.5.4 in the summer, and the early bugs seem shaken out now. Most release write-ups list developer features; I care about what changes for whoever runs the server: renamed binaries, a privilege split that breaks scripts, InnoDB defaults that moved, and the upgrade steps on CentOS 7 and Ubuntu 18.04.
Before you begin: a server on 10.3 or 10.4 with a fresh backup (mariabackup or mysqldump --all-databases --single-transaction), the MariaDB Foundation repository rather than the distribution package so you can pick the exact version, and a maintenance window. The upgrade is a restart plus mysql_upgrade, usually a few minutes.
Renamed binaries
10.5 ships every client and server binary under a mariadb- name, with the old mysql names kept as symlinks:
mysqld -> mariadbd
mysql -> mariadb
mysqldump -> mariadb-dump
mysqladmin -> mariadb-admin
mysql_upgrade -> mariadb-upgrade
mysqlbinlog -> mariadb-binlog
mysql_install_db -> mariadb-install-db
mariabackup (unchanged)
The symlinks mean existing scripts keep working. The visible difference is in process listings and error logs, where you now see mariadbd, and in systemctl status mariadb showing /usr/sbin/mariadbd. Monitoring checks that grep for mysqld need adjusting; I hit that on the first host.
Privilege changes
The SUPER privilege has been split into fine-grained ones: BINLOG ADMIN, BINLOG MONITOR, BINLOG REPLAY, CONNECTION ADMIN, FEDERATED ADMIN, READ_ONLY ADMIN, REPLICATION MASTER ADMIN, REPLICATION SLAVE ADMIN, SET USER. REPLICATION CLIENT is now an alias for BINLOG MONITOR, and SHOW MASTER STATUS requires it. mysql_upgrade maps existing SUPER grants so accounts keep working, but new accounts for tooling should get the specific privilege rather than SUPER:
CREATE USER 'backup'@'localhost' IDENTIFIED BY 'strong-password';
GRANT RELOAD, PROCESS, LOCK TABLES, BINLOG MONITOR ON *.* TO 'backup'@'localhost';
CREATE USER 'repl'@'10.20.30.%' IDENTIFIED BY 'strong-password';
GRANT REPLICATION SLAVE ON *.* TO 'repl'@'10.20.30.%';
Also new: SHOW PRIVILEGES lists them all, and GRANT ... TO PUBLIC does not exist yet, so per-user grants remain.
InnoDB defaults that moved
Several InnoDB settings have new defaults or are deprecated. From SHOW VARIABLES on a 10.4 server compare:
innodb_adaptive_hash_indexnow defaults toOFF. Workloads with heavy point lookups on a hot index may see a small drop; enable it explicitly if you measured a benefit before.innodb_checksum_algorithmdefaults tofull_crc32for new tablespaces. Existing files stay oncrc32and are still read fine.innodb_buffer_pool_instances,innodb_page_cleaners,innodb_log_files_in_groupand several other variables are deprecated and ignored; amy.cnfstill setting them logs a warning at startup, not an error.innodb_flush_methodgainedO_DIRECTas the default on Linux in 10.5.- The
innodb_log_files_in_groupchange means there is exactly one redo log file,ib_logfile0, sized byinnodb_log_file_size.
A minimal [mysqld] block on a 10.5 server on CentOS 7 (/etc/my.cnf.d/server.cnf):
[mysqld]
datadir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
innodb_buffer_pool_size = 8G
innodb_log_file_size = 1G
innodb_flush_log_at_trx_commit = 1
innodb_flush_method = O_DIRECT
innodb_io_capacity = 2000
max_connections = 500
character_set_server = utf8mb4
collation_server = utf8mb4_unicode_ci
log_error = /var/log/mariadb/mariadb.log
slow_query_log = ON
long_query_time = 1
Smaller things
- The
INET6data type stores IPv6 (and IPv4-mapped) addresses in 16 bytes with proper comparison, replacingVARBINARY(16)workarounds. INSERT ... RETURNINGandREPLACE ... RETURNINGreturn the inserted rows, handy for applications that usedLAST_INSERT_ID()round trips.JSON_ARRAYAGG()andJSON_OBJECTAGG()aggregate functions arrived.- The S3 storage engine can archive read-only tables to object storage; it is a plugin, not loaded by default.
- ColumnStore is available as a storage engine plugin in the same server rather than a separate distribution.
- Performance Schema was updated to be closer to MySQL 5.7's instrumentation.
- Binary log:
binlog_row_metadataandbinlog_expire_logs_secondswere added;expire_logs_daysstill works.
Upgrading on CentOS 7
Point the repository at 10.5 (/etc/yum.repos.d/MariaDB.repo):
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64
gpgkey = https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck = 1
sudo systemctl stop mariadb
sudo yum remove -y MariaDB-server MariaDB-client
sudo yum install -y MariaDB-server MariaDB-client MariaDB-backup
sudo systemctl start mariadb
sudo mysql_upgrade
sudo systemctl restart mariadb
Removing the old packages first is what the MariaDB documentation recommends for major upgrades on RPM systems; the data directory is untouched. On Ubuntu 18.04, switch the apt source to 10.5 under http://mirror.../mariadb/repo/10.5/ubuntu bionic main, then apt update && apt install mariadb-server, which runs mysql_upgrade for you.
Replication is supported from a 10.4 primary to a 10.5 replica, so upgrade replicas first, then the primary.
After the restart
SELECT VERSION();
SHOW GLOBAL VARIABLES LIKE 'innodb_checksum_algorithm';
SHOW GLOBAL VARIABLES LIKE 'innodb_adaptive_hash_index';
SHOW ENGINES;
SELECT user, host, JSON_DETAILED(priv) FROM mysql.global_priv WHERE user='backup';
Expect 10.5.8-MariaDB, full_crc32, OFF, InnoDB as default, and the privileges stored as JSON in mysql.global_priv, which replaced mysql.user as the real table in 10.4. Check /var/log/mariadb/mariadb.log for [Warning] ... deprecated lines and clean your configuration accordingly.
If it goes sideways
mysql_upgradeprintsPhase 1/7: Checking and upgrading mysql database ... Error: Table 'mysql.global_priv' doesn't existwhen run against a server that is not actually 10.5. The old binary is still inPATH, or the service did not restart. Confirm withmariadb-admin version.- Startup fails with
[ERROR] mariadbd: unknown variable 'innodb_log_files_in_group=2'. Only a handful of removed variables cause a hard failure; delete the line. Most deprecated ones only warn. - Replication from 10.5 to an older replica breaks with
Unknown system variableerrors. Downstream replicas must be at least the version of the primary. Upgrade in the right order. - Application monitoring shows
SHOW MASTER STATUSfailing withAccess denied; you need (at least one of) the BINLOG MONITOR privilege(s). GrantBINLOG MONITORto the monitoring user;REPLICATION CLIENTalone is no longer enough on accounts created after the upgrade.
The privilege split and the InnoDB defaults matter most to me; the renames are cosmetic thanks to the symlinks. Try your my.cnf against a 10.5 container before touching production.