# MariaDB Unknown Variable After Upgrade: Fix Failed Startup

Source: https://srvscripts.com/guides/mariadb-unknown-variable-after-upgrade/
Updated: 2026-10-03
Publisher: srvScripts (https://srvscripts.com/)

The upgrade finished, the packages are installed, and `systemctl start mariadb` fails within a second. The error log contains a line about an unknown variable or an unrecognised option, and the service exits before it has opened a single table. This is the single most common post-upgrade failure we see, it is entirely caused by configuration, and it is fixed in a minute once you know where to look. This guide covers the diagnosis, the list of variables removed in recent versions, and the redo-log failure that sometimes hides behind it.

In short: MariaDB refuses to start because /etc/my.cnf or a file under /etc/my.cnf.d/ still sets a variable the new version removed, such as query_cache_size or innodb_log_write_ahead_size.

**Short answer:** MariaDB refuses to start because `/etc/my.cnf` or a file under `/etc/my.cnf.d/` still sets a variable the new version removed, such as `query_cache_size` or `innodb_log_write_ahead_size`. Read the exact name from the error log, comment that line out, start the service and repeat until it stays up, then run `mariadb-upgrade` to finish the job.

## Read the actual error

Do not guess. The error log names the variable:

```
systemctl status mariadb --no-pager -l
journalctl -u mariadb --no-pager -n 30
tail -30 /var/lib/mysql/$(hostname).err
```

Look for a line like `unknown variable 'innodb_log_write_ahead_size=8192'` or `unknown option '--query-cache-size'`. On cPanel the log path may be `/var/lib/mysql/<hostname>.err`; on DirectAdmin and standalone servers it can be `/var/log/mariadb/mariadb.log` or wherever `log_error` points. If none of those exist, `journalctl` has it.

The server stops at the first unknown variable it meets, so after fixing one, start again and check for the next; there are often two or three.

## Find every candidate in one pass

Rather than fixing them one at a time, list every non-comment line in the configuration and compare against what the new server knows:

```
grep -hvE '^\s*(#|$|\[)' /etc/my.cnf /etc/my.cnf.d/*.cnf 2>/dev/null | cut -d= -f1 | tr -d ' ' | sort -u > /root/cnf-vars.txt
mariadbd --verbose --help 2>/dev/null | grep -E '^  --' | sed 's/^  --//; s/[ =].*//' | tr '_' '-' | sort -u > /root/known-vars.txt
comm -23
