You upgraded MariaDB from 10.6 to 11.4 on Debian or Ubuntu. Your edited /etc/mysql/mariadb.conf.d/50-server.cnf is still there, untouched, but one or more of its settings no longer apply. In my case it was sql_mode: the server fell back to its strict built-in default, and a legacy PHP application started failing with this:

Copied!
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect date value: '' for column ... at row 1

The cause: the setting sat below the [mariadb-10.6] header in that file. A 10.6 server reads that section. An 11.4 server skips it without a word in the log.

This article is for anyone running MariaDB from Debian or Ubuntu packages who is planning, or has just done, a major-version upgrade. By the end you will know how to see which options your server really reads, find every version-pinned section, move those settings somewhere every version reads, and confirm the result. It assumes you have root on the database server and know what a my.cnf file is.

Last verified: December 2026. Current 11.4 release: 11.4.14 (November 16, 2026). The server in this story went from 10.6 to 11.4.13. Option-file behavior was checked against the MariaDB documentation and the 11.4 source tree. The commands were not rerun for this article: expected output comes from the real incident or from the output format in the source code.

What Happened

A staging database server was upgraded from MariaDB 10.6 to 11.4.13. Afterwards a legacy PHP application threw the 1292 error above while inserting an empty string into a DATE column.

On the upgraded server, the live @@GLOBAL.sql_mode was MariaDB’s built-in default:

Copied!
STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

That default is identical in 10.6 and 11.4. Before the upgrade, a setting that had been placed under a version-specific group in 50-server.cnf replaced it with a mode without STRICT_TRANS_TABLES, so the same insert stored 0000-00-00 with a warning instead of failing. dpkg had kept the edited file and placed the new package version beside it as 50-server.cnf.dpkg-dist. So the file was fine. The server simply was not reading that line.

mariadbd --print-defaults, which prints every option the server would start with, showed no sql_mode at all. Listing the section headers in the file explained why: [server] on line 6, [mysqld] on line 9, [embedded] on line 104, [mariadb] on line 109, and [mariadb-10.6] on line 114. The sql_mode line was line 116. The stock comment above that header says it plainly: the group is read only by MariaDB 10.6 servers.

I set the mode at runtime, moved the line into a new file under [mysqld], and confirmed --print-defaults now showed it. I also restarted PHP-FPM, because persistent connections keep the session mode they were opened with. A fresh connection then showed the non-strict mode. Nothing else lived under the old header, so sql_mode was the only casualty.

How It Works

MariaDB reads settings from option files (.cnf files). Each file is split into groups, and each group starts with a header in square brackets. A program reads only the groups on its own list and skips the rest without comment. That is how one file can hold settings for the server, the command-line client and backup tools at once.

On Linux, MariaDB built from Debian or Ubuntu packaging reads these files in order: /etc/my.cnf, then /etc/mysql/my.cnf, then ~/.my.cnf (with $MARIADB_HOME/my.cnf read before ~/.my.cnf if that variable is set). On Debian and Ubuntu, /etc/mysql/my.cnf is a symlink managed by update-alternatives that points to /etc/mysql/mariadb.cnf. That file sets the socket path and ends with two !includedir lines: first /etc/mysql/conf.d/, then /etc/mysql/mariadb.conf.d/. Inside an included directory, MariaDB reads only files whose names end in .cnf, in byte order of the file name, so 60-local.cnf comes after 50-server.cnf. When the same option appears more than once, the last value read wins.

Option file read order on Debian and Ubuntu: /etc/my.cnf, /etc/mysql/my.cnf linked to mariadb.cnf, conf.d, then mariadb.conf.d in byte order with 50-server.cnf before 60-local.cnf, then ~/.my.cnf. A .dpkg-dist file is not read. Read order for a Debian/Ubuntu MariaDB server. The .dpkg-dist copy is never read because its name does not end in .cnf.

The server reads these groups: [client-server], [server], [mysqld], [mysqld-X.Y], [mariadb], [mariadb-X.Y], [mariadbd], [mariadbd-X.Y], and [galera] on builds with Galera support (the Debian and Ubuntu builds have it). X.Y is the server’s major.minor version, filled in when the server is compiled. In the source, the version groups are the strings mysqld-, mariadb- and mariadbd- followed by that X.Y, and a header must match a whole group name; a partial name such as [mariadb-11] matches nothing. A 10.6 server looks for [mariadb-10.6]. An 11.4 server looks for [mariadb-11.4] and passes over [mariadb-10.6] without logging anything.

Version groups exist for a good reason. If you share one config file between servers of different versions, an option that only the newer version knows would stop the older one from starting. The version group lets you hide it from the older server. The packaged 50-server.cnf ships an empty one, and in both the 10.6 and 11.4 packaging it is the last header in the file. Anything appended to the bottom of the file lands inside it.

Table: the 10.6 server applies [server], [mysqld], [mariadb] and [mariadb-10.6]; the 11.4 server applies the first three and skips [mariadb-10.6] with no warning. The same file, read by two versions. Only the version-pinned section changes meaning.

Prerequisites

  • A MariaDB server installed from Debian or Ubuntu packages (the distribution’s or MariaDB’s own repository), already upgraded or about to be.
  • Root shell on the database server. The commands use sudo mariadb, which logs in as the MariaDB root account over the Unix socket (the default for new installs since 10.4). If your root account uses a password, add -p.
  • The old major version number, for example 10.6.
  • A list of the settings you expect to be in effect, for example sql_mode, innodb_buffer_pool_size and max_connections.
  • A maintenance window if you need to restart the server.

Step 1: Compare Live Values With What You Configured

Start with what the server is really running, not with what the file says.

Copied!
sudo mariadb -e "SELECT VERSION(), @@GLOBAL.sql_mode\G"

On my server after the upgrade (the suffix after 11.4.13-MariaDB depends on the package build):

Copied!
*************************** 1. row ***************************
        VERSION(): 11.4.13-MariaDB-<SUFFIX>
@@GLOBAL.sql_mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Check the other settings you rely on the same way:

Copied!
sudo mariadb -e "SHOW GLOBAL VARIABLES WHERE Variable_name IN ('sql_mode','innodb_buffer_pool_size','max_connections');"

Any value that matches the built-in default when your config says otherwise is a candidate for this problem.

Step 2: See What the Server Reads

--print-defaults must be the first option on the line. It prints the options the server would start with, then exits without starting anything.

Copied!
sudo mariadbd --print-defaults | tr ' ' '\n' | grep -i 'sql.mode'

On my server this printed nothing, which proved the line in the file was not being read. my_print_defaults --mysqld gives the same list, one option per line, from the same groups the server reads:

Copied!
sudo my_print_defaults --mysqld

To see which files are read and in what order:

Copied!
my_print_defaults --help | grep -A1 'given order'
Copied!
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf

Step 3: Find Every Version-Pinned Group

Search all option files for headers that carry a version number:

Copied!
sudo grep -rnE '^[[:space:]]*\[(mysqld|mariadb|mariadbd)-[0-9]+\.[0-9]+\]' /etc/mysql/ /etc/my.cnf /etc/my.cnf.d/ 2>/dev/null

On my server the header that mattered was on line 114, which this search reports as:

Copied!
/etc/mysql/mariadb.conf.d/50-server.cnf:114:[mariadb-10.6]

A [mariadb-11.4] header in 50-server.cnf.dpkg-dist may show up too. That file is not read, so ignore it.

Now print what the old version’s groups contain. my_print_defaults accepts group names as arguments, so ask for the 10.6 groups directly (replace 10.6 with your old version):

Copied!
sudo my_print_defaults mysqld-10.6 mariadb-10.6 mariadbd-10.6
Copied!
--sql_mode=NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Every line printed here was applied by the old server and is ignored by the new one. For a complete before-and-after comparison, compare the old version’s full group list with the new one:

Copied!
sudo my_print_defaults client-server server mysqld mysqld-10.6 mariadb mariadb-10.6 mariadbd mariadbd-10.6 galera | sort > /tmp/groups-old.txt
sudo my_print_defaults --mysqld | sort > /tmp/groups-new.txt
diff /tmp/groups-old.txt /tmp/groups-new.txt

Lines starting with < are settings the old server used that the new one does not read. (If you do not run Galera, drop galera from the first list.)

Step 4: Restore the Value at Runtime (If You Need Relief Now)

If production is failing, set the value live while you fix the file. SET GLOBAL sql_mode requires the SUPER privilege, so run it as the administrative account.

Copied!
sudo mariadb -e "SET GLOBAL sql_mode='NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; SELECT @@GLOBAL.sql_mode;"

A global change applies only to connections opened after it. Applications with persistent connections (PHP’s PDO::ATTR_PERSISTENT, connection pools in other languages) keep the old session value until those connections close. List the long-idle ones:

Copied!
sudo mariadb -e "SELECT ID, USER, HOST, TIME FROM information_schema.PROCESSLIST WHERE COMMAND = 'Sleep' ORDER BY TIME DESC;"

Restart the application’s worker pool (for PHP-FPM, sudo systemctl restart php<VERSION>-fpm on the app server) or KILL <ID> the stale connections. Not every variable can be changed at runtime. The MariaDB system-variable pages mark each one as dynamic or not. Static ones wait for the restart in Step 7.

Step 5: Move the Settings Into a Version-Neutral File

Put local settings in a file you own rather than in the package’s 50-server.cnf. A package upgrade does not overwrite a file the package did not install, and the 60- prefix makes it load after 50-server.cnf, so its values win.

Copied!
sudo vim /etc/mysql/mariadb.conf.d/60-local.cnf

(In vim, press i to insert, then Esc and :wq to save and quit.)

Copied!
# Local server settings. Kept in a version-neutral group on purpose:
# version groups such as [mariadb-10.6] are skipped after a major upgrade.
[mysqld]
sql_mode = "NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

[mysqld] is read by every MariaDB server version, and [mariadbd] by 10.4 and later. Then remove or comment out the old line under [mariadb-10.6] in 50-server.cnf so nobody edits it later thinking it still applies.

Before you move any other option, check that the new version still has it. An unknown option in a group the server reads stops the server from starting, with unknown variable and the option name in the log. innodb_defragment, for example, was removed between 10.11 and 11.4. An empty result here means the 11.4 server does not know the option:

Copied!
sudo mariadb -e "SHOW GLOBAL VARIABLES LIKE 'innodb_defragment%';"

Confirm the server will now read the value:

Copied!
sudo my_print_defaults --mysqld | grep -i 'sql.mode'
Copied!
--sql_mode=NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Step 6: Fold In the Package’s New Default File

With your edits moved to 60-local.cnf, you can let the package’s own 50-server.cnf go back to stock, which also means the next upgrade will not stop to ask about it. Compare the two first:

Copied!
sudo diff -u /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/mariadb.conf.d/50-server.cnf.dpkg-dist

Copy every local change you still want into 60-local.cnf (bind-address is a common one: the stock file sets 127.0.0.1, which refuses connections from other hosts). Read the + lines too: the new file can change defaults on its own (the current 11.4 packaging sets character-set-collations = utf8mb4=uca1400_ai_ci, for example). Then keep a backup outside the include directory and swap the files:

Copied!
sudo cp -a /etc/mysql/mariadb.conf.d/50-server.cnf /root/50-server.cnf.pre-upgrade
sudo mv /etc/mysql/mariadb.conf.d/50-server.cnf.dpkg-dist /etc/mysql/mariadb.conf.d/50-server.cnf

The backup goes in /root because any file in mariadb.conf.d whose name ends in .cnf is read, backups included.

Step 7: Restart and Watch the Log

Restart in your maintenance window and check that the server came back:

Copied!
sudo systemctl restart mariadb
systemctl is-active mariadb
sudo journalctl -u mariadb -n 30 --no-pager

is-active should print active. If it prints failed, the journal shows why, and an unknown variable line points at an option to remove. Afterwards, restart application worker pools that hold persistent connections so they reconnect with the new values.

Verify

Rerun Step 1. The live values should now match 60-local.cnf:

Copied!
sudo mariadb -e "SELECT @@GLOBAL.sql_mode\G"
Copied!
*************************** 1. row ***************************
@@GLOBAL.sql_mode: NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Rerun the grep and the diff from Step 3. No version-pinned group should hold settings any more, and the diff should print nothing.

For sql_mode specifically, test the behavior and not just the string. This uses a temporary table that disappears when the session ends (replace <APP_DB> with the application’s database):

Copied!
sudo mariadb <APP_DB> -e "CREATE TEMPORARY TABLE t (d DATE); INSERT INTO t VALUES (''); SELECT d FROM t;"

In the non-strict mode the SELECT returns 0000-00-00. In strict mode the INSERT fails with the same 1292 error as the application. For the strongest test, open a fresh connection from the application server, over the same network path the application uses, and run SELECT @@SESSION.sql_mode; there. A new connection shows the mode new application connections will get.

Pre-Upgrade Checklist for MariaDB Major Upgrades

Run through this before the next major upgrade, whatever the version.

  • Back up and snapshot first. Take a mariadb-backup or dump, and snapshot the VM if it is one (see Snapshot Before You Touch Production). Upgrade a staging copy before production.
  • Record the effective config. sudo my_print_defaults --mysqld | sort > ~/defaults-before.txt and sudo mariadb -e 'SHOW GLOBAL VARIABLES' > ~/vars-before.txt (the redirect runs as you, not as root, so write to your own home directory). Diff both after the upgrade (the variables list will also show new variables and changed defaults).
  • Empty the version groups. Run the grep from Step 3 and move anything under [mysqld-X.Y], [mariadb-X.Y] or [mariadbd-X.Y] into a version-neutral file now, while the old server can still confirm it reads it.
  • Remove options the new version dropped. Read MariaDB’s upgrade notes for every step you cross. For 10.6 to 11.4 that means both the 10.6 to 10.11 and the 10.11 to 11.4 pages. innodb_defragment and its related options and old_alter_table are gone in 11.4.
  • Expect a conffile question. If you edited a packaged file such as 50-server.cnf, dpkg asks whether to keep yours (a non-interactive run follows any --force-confold or --force-confnew option you pass). Keeping it leaves the new version beside it as .dpkg-dist. Afterwards, find /etc/mysql -name '*.dpkg-*' shows what to review.
  • Check the maintenance credentials. On Debian packaging, /etc/mysql/debian-start runs after every server start and calls mariadb-upgrade in the background with the credentials in /etc/mysql/debian.cnf. Test them the same way: sudo mariadb --defaults-extra-file=/etc/mysql/debian.cnf -e 'SELECT 1'. After the upgrade, sudo mariadb-upgrade --check-if-upgrade-is-needed; echo $? should print 1, which means no upgrade is needed.
  • Plan to restart the applications too. Persistent connections keep old session settings across a global change.
  • Pick the target on purpose. MariaDB’s community support for 10.6 ended on July 6, 2026 (your distribution may still patch its own 10.6 package; check its security tracker). 11.4 is an LTS release supported until May 29, 2029. 11.8 (until June 4, 2028) and 12.3 (until June 12, 2029) are also LTS. MariaDB’s documentation says you can upgrade directly from any earlier version to the latest one; the notes for each step you skip still apply. These dates change rarely, but check MariaDB’s maintenance policy page before you commit.

Troubleshooting

--print-defaults shows the right value but the live value is different: something changes it after startup. Look for a SET GLOBAL in someone’s script, a non-empty init_connect (SELECT @@GLOBAL.init_connect;), or an application that sets its own session mode when it connects. Search the application code for sql_mode (in any letter case) and for init-command options.

The error keeps appearing after the fix: check the log line’s timestamp before you chase anything; an old line can look like a new failure. If the failure is fresh, the application is probably still using a connection opened before the change. Restart its worker pool.

The server will not start after you moved settings, and the journal says unknown variable: the option no longer exists in this version. That is exactly what the version group was hiding. Delete it, or rename it if the upgrade notes list a replacement. A loose- prefix (for example loose-innodb_defragment = 1) turns the error into a warning, but it also brings back the silent failure this article is about, so I avoid it.

A setting you deleted is still applied: another file sets it later in the read order. sudo grep -rn '<OPTION_NAME>' /etc/mysql/ finds every copy. Watch for backup copies saved as *.cnf inside mariadb.conf.d, because those are read too.

mariadb-admin (or the logrotate job) fails with Access denied for user 'root'@'localhost' (using password: NO): /etc/mysql/debian.cnf has a blank password and the MariaDB root account authenticates only with a password. I hit this on several servers, where logrotate’s mariadb-admin flush-logs failed on the credentials in debian.cnf. On two of them I switched root to Unix-socket authentication (IDENTIFIED VIA unix_socket), which fixed it. To keep password login as a fallback as well, list both methods. Log in with sudo mariadb -p and type the statement at the MariaDB [(none)]> prompt, so the password stays out of your shell history and the process list:

Copied!
ALTER USER 'root'@'localhost' IDENTIFIED VIA unix_socket OR mysql_native_password USING PASSWORD('<ROOT_PASSWORD>');

The client still saves the statement in its own history file (.mariadb_history in the home directory it runs with), so delete that line afterwards. ALTER USER drops any authentication method you leave out, so list both. On a production server I left it alone, because debian.cnf is also read by /etc/init.d/mariadb and /etc/mysql/debian-start.

Sources and further reading