Skip to content

Upgrading MariaDB from 10.5 to 10.6 on a cPanel server without breaking the user mapping

cPanel's MySQL/MariaDB Upgrade wizard runs mysql_upgrade and updates the system tables. What it does not do is verify your applications survive the InnoDB redo log format change.

cPanel ships a MySQL/MariaDB Upgrade tool under WHM > SQL Services. It runs mysql_upgrade, updates the system tables, restarts the daemon, and reports success. The wizard says you’re on 10.6 and the home page shows the new version. What the wizard does not check is whether your applications still work. MariaDB 10.6 changed the InnoDB redo log format incompatibly, deprecated several SQL_MODE values that some old apps depend on, and tightened group-by enforcement. The upgrade goes smoothly; the breakage shows up on the first request.

What’s happening

MariaDB 10.5 to 10.6 is a “minor” version bump in name only. The relevant changes:

  • InnoDB redo log format changed: 10.6 cannot read 10.5 redo logs. The upgrade tool handles this by doing a clean shutdown (flushing redo to data files), so the upgrade works. But if MariaDB crashes during upgrade and you boot 10.5 against half-applied data, you can corrupt the data files. Always have a backup.
  • SQL_MODE defaults tightened: ONLY_FULL_GROUP_BY is now part of STRICT_TRANS_TABLES default. Applications with old GROUP BY clauses that did not list every selected column now error with “non-aggregated columns.”
  • utf8 deprecation: 10.6 emits a deprecation warning when utf8 is used as a charset name, recommending utf8mb3 or utf8mb4. Apps that parse warning streams break.
  • mysql.user table changed: the Password column is gone, replaced by authentication_string. Tools that GRANT or modify users via raw SQL against mysql.user fail.

How to verify

Before the upgrade:

mysql -e "SELECT VERSION()"
mysql -e "SHOW VARIABLES LIKE 'sql_mode'"
grep "innodb_log_file_size\|innodb_redo_log" /etc/my.cnf /etc/my.cnf.d/*.cnf 2>/dev/null
whmapi1 list_dbs | grep -c "name:"
du -sh /var/lib/mysql
df -h /var/lib/mysql

After:

mysql -e "SELECT VERSION()"
mysql -e "SHOW VARIABLES LIKE 'sql_mode'"
mysql -e "SHOW WARNINGS"
journalctl -u mariadb --since "10 minutes ago" | grep -i error
whmapi1 list_dbs | grep -c "name:"

The dbmap count should match before and after. The error log should be clean. The SQL_MODE difference is the first place applications will trip.

The fix

  1. Take a full mysqldump of every account before the upgrade. Even if the wizard says success, you want a known-good restore point. mysqldump --all-databases --single-transaction --routines --triggers --events --hex-blob --default-character-set=utf8mb4 | gzip > /backup/pre-106.sql.gz.
  2. Confirm 10.5 is at the latest patch level before crossing to 10.6: yum update MariaDB-server MariaDB-client. Crossing from an old 10.5 to 10.6 occasionally hits bugs already fixed in late 10.5 patches.
  3. Disable cPanel updates during the window: WHM > Update Preferences. The cpsrvd background updater can re-run mysql_upgrade halfway through, which is bad.
  4. Run the upgrade: WHM > MySQL/MariaDB Upgrade, select 10.6, confirm. The wizard stops the daemon, swaps packages, starts the daemon, runs mysql_upgrade --force. Expect 5–15 minutes for a typical host. Do not interrupt.
  5. Verify immediately: mysql -e "SELECT VERSION()" shows 10.6.x. journalctl -u mariadb is clean. whmapi1 list_dbs returns the same count.
  6. Adjust SQL_MODE for legacy apps: if customer apps fail on ONLY_FULL_GROUP_BY, the right answer is to fix the app’s queries — they are non-deterministic. The faster answer (during the upgrade window) is to set sql_mode='STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' in /etc/my.cnf.d/cpanel.cnf and revert each app’s SET sql_mode calls. Then file tickets to fix the apps properly.
  7. Smoke-test the top 5 customer sites: load the homepage, log in, run a write operation. Catch the breakage in your maintenance window, not in a Monday morning ticket avalanche.
  8. Do not roll back across the redo log boundary. Once 10.6 has flushed the redo log, going back to 10.5 means restoring from the dump. No in-place downgrade.

For cPanel hosts where the MariaDB version is overdue and the customer site catalog is large, Stack Harbor’s managed cPanel operations team plans the upgrade with per-app smoke tests scripted in advance and rollback plans tested against a clone of the host.