MariaDB 12.0 was never meant to stay on your servers. It was a short-term rolling release, its last build shipped in August 2025, and MariaDB’s own deb.mariadb.org path for it now returns a 404. The line to run is 12.3, the long-term release MariaDB maintains until June 2029. This guide shows how to install MariaDB 12.3 on Debian 13 and Debian 12 from the official repository, using a deb822 .sources file with its own keyring instead of the old setup script.
We also cover the 12.x features that matter on a real server: MySQL compatible caching_sha2_password logins, SET SESSION AUTHORIZATION and the new innodb_index_shrink switch. If you’re still on 12.0, there is an in-place upgrade that kept our test data intact. Every command below was run on Debian 13 and Debian 12 with MariaDB 12.3.3 in November 2026, and the errors we hit on the way are at the end.
Pick the right MariaDB line
Run the 12.3 line on a new Debian server unless something pins you elsewhere. It is the newest long-term release, it gets fixes until June 2029, and it carries everything that landed in the 12.x rolling releases before it. The dates below come from the MariaDB maintenance policy:
| Line | Type | Supported until | Pick it when |
|---|---|---|---|
| 12.3 | Long-term | June 2029 | New installs, and anyone leaving 12.0 |
| 11.8 | Long-term | June 2028 | You’d rather take Debian 13’s own package |
| 11.4 | Long-term | May 2029 | An application is certified against 11.4 |
| 10.11 | Long-term | February 2028 | Only as Debian 12’s stock package, while you plan the move off it |
| 13.x | Rolling | Short (13.0: Q4 2026, 13.1: Q1 2027) | Trying new features on servers you can rebuild |
| 12.0 | Short-term rolling | Not listed in the policy, no release since August 2025 | Never for new installs; upgrade it to 12.3 |
Debian’s own repositories will not give you 12.3. Trixie carries 11.8 and bookworm carries 10.11, which is why the next sections add MariaDB’s repository. If an application needs 11.4, our guide to installing MariaDB 11.4 LTS on Debian follows the same pattern with a different version in the repository URL. Rolling releases are where new features show up first, but each one is supported for months rather than years, so we keep them off anything we can’t rebuild in an afternoon.
Check the prerequisites
You need very little to follow along:
- Debian 13 (trixie) or Debian 12 (bookworm) on amd64
- A user with sudo rights
- 2 vCPU and 4 GB of RAM as a floor
- The IP range of your application servers, if they’ll connect remotely
That 2 vCPU, 4 GB size is the VM we tested on, not a production target. Real sizing comes from the working set: InnoDB wants the hot part of your data in its buffer pool, so a dedicated database host usually gives the pool about 70% of RAM and you buy RAM to match. Disk needs room for the data, for binary logs if you replicate, and for at least one full mariadb-backup copy, so plan on three times the data size before growth. Connection count adds memory too, because each session gets its own sort and join buffers.
On another distro, the same 12.x setup is covered for Ubuntu, Rocky Linux and AlmaLinux, and Fedora.
Add the MariaDB 12.3 repository
MariaDB signs its packages with one release key. Save it under /etc/apt/keyrings, so apt trusts it for this repository only and not for every source on the system:
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl
sudo mkdir -p /etc/apt/keyrings
sudo curl -o /etc/apt/keyrings/mariadb-keyring.asc 'https://mariadb.org/mariadb_release_signing_key.pgp'
Next comes the repository file. Debian 13’s apt prefers the deb822 format and Debian 12’s apt reads it fine, so one file works on both. Open it:
sudo vim /etc/apt/sources.list.d/mariadb.sources
Paste the following. On Debian 12, change Suites to bookworm and leave everything else alone:
X-Repolib-Name: MariaDB
Types: deb
URIs: https://deb.mariadb.org/12.3/debian
Suites: trixie
Components: main
Signed-By: /etc/apt/keyrings/mariadb-keyring.asc
Signed-By ties the repository to the key you just saved, and the 12.3 in the URI is what keeps you on the long-term line. When a newer LTS ships, nothing moves until you edit that number yourself. Refresh the index and ask apt which version it would install:
sudo apt update
apt policy mariadb-server
The candidate has to come from deb.mariadb.org, not from Debian’s mirror. If it does not, nothing you install next will be 12.3.

On Debian 13 the version table lists 12.3.3 and 12.3.2 from MariaDB’s repository above trixie’s own 11.8.6. Debian 12 shows the same pair with a deb12 suffix, sitting above bookworm’s 10.11.19. If the candidate still ends in deb13u1 or deb12u1, apt skipped the new file, and the last section covers the two reasons we ran into.
Install MariaDB 12.3 on Debian
Install the server, the client and mariadb-backup together. The backup tool is a separate package, and it is better to have it now than to find it missing on the night you need a restore:
sudo apt install -y mariadb-server mariadb-client mariadb-backup
The install prints one line that looks like a failure and is not: update-alternatives: error: no alternatives for my.cnf. We saw it on both Debian versions, and the very next line points /etc/mysql/my.cnf at mariadb.cnf, which is the result you want. Confirm the client and server versions:
mariadb --version
sudo mariadb -e 'SELECT VERSION();'
Both report the same build.
mariadb from 12.3.3-MariaDB, client 15.2 for debian-linux-gnu (x86_64) using EditLine wrapper
VERSION()
12.3.3-MariaDB-deb13
The deb13 suffix confirms the build came from MariaDB’s trixie repository. On Debian 12 the same query returns 12.3.3-MariaDB-deb12. If you see a 0+deb13u1 style version instead, Debian’s own package won the install, so remove it and check the repository file before going further.
Start MariaDB and enable it at boot
On Debian 13 the package starts MariaDB and enables it at boot, so all that’s left is to look:
systemctl status mariadb --no-pager
Read two things: active (running), and enabled on the Loaded line. The unit description names the 12.3.3 server, and the startup log ends with it listening on 127.0.0.1 port 3306, which is the safe default until you open it up later:

Debian 12 behaved differently in our run. The server was running after the install, but systemctl is-enabled reported disabled, so it would not have come back after a reboot, and nothing in the install output warned about it. Enable it explicitly on bookworm:
sudo systemctl enable --now mariadb
Run systemctl is-enabled mariadb again afterwards. It should now read enabled, because enable --now both starts the unit and adds it to the boot target. A database that silently skips a reboot is the kind of fault you only find at 3 a.m., so check it now:

Running enable --now on Debian 13 does no harm either. If you script installs for both versions, put the line in for both and stop thinking about it.
Secure the root account
A fresh 12.3 install is already locked down. Root logs in through the Unix socket only, so sudo mariadb works while a password guess over the network goes nowhere. You can see it in the root account’s definition:
sudo mariadb -e "SHOW CREATE USER root@localhost;"
This is what our Debian 13 server returned.
CREATE USER for root@localhost
CREATE USER `root`@`localhost` IDENTIFIED VIA mysql_native_password USING 'invalid' OR unix_socket
USING 'invalid' means no password can ever match, and OR unix_socket lets the operating system’s root user in. The mariadb-secure-installation script still ships, and it still removes anonymous users and the test database if anything created them:
sudo mariadb-secure-installation
Press Enter at the password prompt, answer n to switching to unix_socket and to changing the root password, then Y to everything else. On 12.3 the script opens by admitting it is mostly redundant:
NOTE: MariaDB is secure by default. Running this script is mostly
unecessary and it will likely be removed in a future release,
but it is for now preserved for backwards compatibility.
We still run it once on every new server. It takes ten seconds, it ended with All done! on both of ours, and it proves the defaults are what you think they are before an application ever connects.
Create a database and an application user
Applications should never connect as root. Set the database name, user and password once as shell variables, so the commands in this section and the remote access one work as written. Replace the password with your own:
export DB_NAME=appdb
export DB_USER=appuser
export DB_PASS='Str0ng#AppPass26'
Create the database, the user and the grant in one call.
sudo mariadb -e "CREATE DATABASE ${DB_NAME}; CREATE USER '${DB_USER}'@'localhost' IDENTIFIED BY '${DB_PASS}'; GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'localhost';"
Then check what the account ended up with.
sudo mariadb -e "SHOW GRANTS FOR '${DB_USER}'@'localhost';"
You should get exactly two grant lines.
Grants for appuser@localhost
GRANT USAGE ON *.* TO `appuser`@`localhost` IDENTIFIED BY PASSWORD '*C1B1F059318B4F663501ABE9E77430BFBDB716EE'
GRANT ALL PRIVILEGES ON `appdb`.* TO `appuser`@`localhost`
USAGE on everything only means the account exists, and the real rights sit on appdb alone. If you ever see ALL PRIVILEGES ON *.*, the grant landed at the wrong scope and the account can read every database on the server. Our guide to showing grants for all MySQL and MariaDB users audits every account in one query. If this database backs a PHP application, the LAMP stack on Debian guide picks up from here, and phpMyAdmin on Debian puts a web UI on top.
Accept MySQL caching_sha2_password logins
caching_sha2_password is MySQL’s default authentication plugin, and 12.3 ships a compatible version so accounts moved from MySQL keep their existing password hashes. It is a migration tool. The plugin documentation recommends PARSEC for new accounts, so we’d only reach for this when users are coming over from MySQL 8 or a client library refuses anything else.
The library is in the package but not loaded. Our first attempt loaded it with INSTALL SONAME, and the very next statement failed because the server dropped the connection with ERROR 2006 (HY000): Server has gone away. The error log had the reason: caching_sha2_password: failed to read private_key.pem. The plugin generates its RSA key pair at server startup, not at install time, so restart MariaDB once after loading it:
sudo mariadb -e "INSTALL SONAME 'auth_mysql_sha2';"
sudo systemctl restart mariadb
After the restart the plugin is ACTIVE and both key files sit in /var/lib/mysql. Create a user with it, then log in over TCP to prove the handshake works end to end:
sudo mariadb -e "CREATE USER 'legacyapp'@'localhost' IDENTIFIED VIA caching_sha2_password USING PASSWORD('Legacy#Pass2026'); GRANT SELECT ON appdb.* TO 'legacyapp'@'localhost';"
mariadb -h 127.0.0.1 -u legacyapp -p'Legacy#Pass2026' -e 'SELECT CURRENT_USER();'
This capture shows the whole sequence on our Debian 12 server, including the plugin and key file checks.

In a real migration you will not type passwords at all. You copy each hash from MySQL’s mysql.user table and create the account with IDENTIFIED WITH caching_sha2_password USING and that string. MySQL’s hashes can contain non-printable bytes, so move them with a query into a file, never by copying from a terminal window.
Switch users with SET SESSION AUTHORIZATION
SET SESSION AUTHORIZATION is the cleanest way we’ve found to test what an application account can actually see without knowing its password. The account doing the switch needs the SET USER privilege. Without it, our first try failed with ERROR 1873 (28000): Access denied trying to change to user. Grant it, then switch and query as the other account:
sudo mariadb -e "GRANT SET USER ON *.* TO 'appuser'@'localhost';"
mariadb -u appuser -p'Str0ng#AppPass26' -e "SET SESSION AUTHORIZATION 'legacyapp'@'localhost'; SELECT CURRENT_USER(), USER(); SHOW GRANTS;"
Both CURRENT_USER() and USER() change to legacyapp, and SHOW GRANTS lists legacyapp’s rights, not appuser’s. The last command in the capture shows the limit you’ll hit in scripts, because the switch is refused inside an open transaction:

We granted SET USER to appuser only to keep the demo short. Whoever holds it can act as other accounts without their passwords, so on a real server it belongs on a DBA account and never on the user your application logs in with.
Check the innodb_index_shrink setting
12.3.3 added one InnoDB switch worth knowing on write-heavy servers. When an UPDATE makes a record longer, say a NULL column gets a value, InnoDB can merge or reorganize B-tree pages to make room. Setting innodb_index_shrink to OFF makes it split pages instead, which cuts index latch contention at the price of slightly emptier pages. ON keeps the old behaviour and is the default. Read it, then flip it off and back on:
sudo mariadb -t -e "SELECT VARIABLE_NAME, GLOBAL_VALUE, DEFAULT_VALUE, READ_ONLY FROM information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='INNODB_INDEX_SHRINK';"
sudo mariadb -e "SET GLOBAL innodb_index_shrink = OFF; SHOW GLOBAL VARIABLES LIKE 'innodb_index_shrink';"
sudo mariadb -e "SET GLOBAL innodb_index_shrink = ON; SHOW GLOBAL VARIABLES LIKE 'innodb_index_shrink';"
READ_ONLY is NO, so the setting changes at runtime with no restart:

Leave it ON unless you’ve measured latch waits on an update-heavy table. Turning it off trades disk space for less contention, and on a read-mostly database you’d pay the space for nothing. A server still on 12.3.2 does not have the variable at all, which is one more reason to keep packages current within the line.
Allow remote connections
A fresh install listens on 127.0.0.1 only, so nothing outside the host can reach it, and that is the right default until you know which machines need in. To let your application servers connect, change bind-address in the server config. Open the file.
sudo vim /etc/mysql/mariadb.conf.d/50-server.cnf
Find the bind-address line, line 27 in our copy, and make it listen on all interfaces:
bind-address = 0.0.0.0
Restart the service and confirm the listener moved.
sudo systemctl restart mariadb
sudo ss -tlnp | grep 3306
The socket now shows the wildcard address.
LISTEN 0 80 0.0.0.0:3306 0.0.0.0:* users:(("mariadbd",pid=2989,fd=25))
0.0.0.0:3306 means the port is open on every interface, so from here the firewall and the account’s host pattern are what keep strangers out. Create an account that can only log in from your application subnet:
sudo mariadb -e "CREATE USER '${DB_USER}'@'10.0.1.%' IDENTIFIED BY '${DB_PASS}'; GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'10.0.1.%';"
Debian does not turn on a firewall by default, and ufw is the quickest way to get one. Allow SSH before you enable it, or it’ll cut the session you’re typing in:
sudo apt install -y ufw
sudo ufw allow OpenSSH
sudo ufw allow from 10.0.1.0/24 to any port 3306 proto tcp
sudo ufw --force enable
sudo ufw status numbered
Port 3306 is open to one subnet and nothing else. Rule 2 is the one that matters here, and the two OpenSSH rules keep your session alive.
Status: active
To Action From
-- ------ ----
[ 1] OpenSSH ALLOW IN Anywhere
[ 2] 3306/tcp ALLOW IN 10.0.1.0/24
[ 3] OpenSSH (v6) ALLOW IN Anywhere (v6)
From an application server on that subnet, connect to the database host and check which TLS version the session uses:
mariadb -h 10.0.1.50 -u appuser -p'Str0ng#AppPass26' -e 'SELECT @@hostname, VERSION(), CURRENT_USER();'
mariadb -h 10.0.1.50 -u appuser -p'Str0ng#AppPass26' -e "SHOW SESSION STATUS LIKE 'Ssl_version'"
We never configured a certificate, yet the session came up on TLSv1.3. Since the 11.4 line, MariaDB generates a self-signed certificate at startup when none is set and the client encrypts by default, so passwords don’t cross the network in clear text even on a stock install. That holds for MariaDB’s own 11.4 and newer clients, while older clients and other connectors may connect without TLS unless you ask for it:

On a cloud VM, ufw is only half of it. The provider’s firewall or security group also has to allow 3306 from the same range, or connections time out before they reach the host. For clients outside one subnet, put the server on a private network or behind a VPN instead of widening the ufw rule. When one node stops being enough, MariaDB replication on Debian covers the primary and replica pair, and our MariaDB high availability cluster with Galera, HAProxy and Keepalived builds on this same install.
Upgrade MariaDB 12.0 to 12.3
If you followed the earlier version of this guide, your server runs 12.0 from MariaDB’s dlm.mariadb.com repository, set up by the mariadb_repo_setup script. That path still serves 12.0.2, but nothing newer is coming. Moving to 12.3 is an in-place package upgrade, and our test database came through untouched. The order matters, because a dump taken after the packages change is no use as a way back:
- Dump every database
- Move the old 12.0 repository file aside
- Add the 12.3 key and
.sourcesfile - Upgrade the MariaDB packages only
- Check the system tables and your data
Downgrading packages is not a supported way back, so the dump is your only undo. Take it first:
sudo mariadb-dump --all-databases --single-transaction --routines --events | gzip > ~/pre-12.3-upgrade.sql.gz
Next, retire the old repository file. On our Debian 13 server the script had written /etc/apt/sources.list.d/mariadb.sources, while older runs of it wrote mariadb.list, so list the directory and move whichever one is there. Both variants are below, so run the one that matches:
ls /etc/apt/sources.list.d/
sudo mv /etc/apt/sources.list.d/mariadb.sources /root/mariadb-12.0.sources.bak
sudo mv /etc/apt/sources.list.d/mariadb.list /root/mariadb-12.0.list.bak
The script’s file also carried a MaxScale repository, and moving it drops that too, which is what you want unless MaxScale runs on the database host. Now add the key and the 12.3 .sources file exactly as in the repository section above, then refresh and list what will change:
sudo apt update
apt list --upgradable 2>/dev/null | grep -i maria
Ten MariaDB packages move from 12.0.2 to 12.3.3.
libmariadb3/trixie 1:12.3.3+maria~deb13 amd64 [upgradable from: 1:12.0.2+maria~deb13]
mariadb-backup/trixie 1:12.3.3+maria~deb13 amd64 [upgradable from: 1:12.0.2+maria~deb13]
mariadb-client-compat/trixie 1:12.3.3+maria~deb13 all [upgradable from: 1:12.0.2+maria~deb13]
mariadb-client-core/trixie 1:12.3.3+maria~deb13 amd64 [upgradable from: 1:12.0.2+maria~deb13]
mariadb-client/trixie 1:12.3.3+maria~deb13 amd64 [upgradable from: 1:12.0.2+maria~deb13]
mariadb-common/trixie 1:12.3.3+maria~deb13 all [upgradable from: 1:12.0.2+maria~deb13]
mariadb-server-compat/trixie 1:12.3.3+maria~deb13 all [upgradable from: 1:12.0.2+maria~deb13]
mariadb-server-core/trixie 1:12.3.3+maria~deb13 amd64 [upgradable from: 1:12.0.2+maria~deb13]
mariadb-server/trixie 1:12.3.3+maria~deb13 amd64 [upgradable from: 1:12.0.2+maria~deb13]
mysql-common/trixie 1:12.3.3+maria~deb13 all [upgradable from: 1:12.0.2+maria~deb13]
Upgrade only the MariaDB packages, so the rest of the system does not change in the same maintenance window.
sudo apt install -y --only-upgrade mariadb-server mariadb-client mariadb-backup
The packages restart the server on the new binaries, and nothing new gets pulled in. We filtered the apt output down to the lines that matter:

You don’t have to run mariadb-upgrade by hand. Debian’s start script runs it after the restart, and running it again only confirms the system tables are current. Check that and the data in one go:
sudo mariadb-upgrade
sudo mariadb -e 'SELECT * FROM shop.orders;'
Our three test rows were all there. Run the same check against a table your application writes to, because that is the data you would miss first.

If mariadb-upgrade starts working through tables instead, let it finish. That is the same job, run because the start script hadn’t got to it yet.
Tune memory and log slow queries
The packaged defaults give InnoDB a 128 MB buffer pool, which suits a laptop. Put your overrides in a file of their own so a package upgrade never touches them:
sudo vim /etc/mysql/mariadb.conf.d/70-tuning.cnf
These values fit our 4 GB lab VM. On a dedicated database host, set the buffer pool near 70% of RAM instead:
[mariadb]
innodb_buffer_pool_size = 2G
innodb_log_file_size = 512M
max_connections = 200
slow_query_log = ON
long_query_time = 1
Restart and read the values back from the running server.
sudo systemctl restart mariadb
sudo mariadb -e "SELECT @@innodb_buffer_pool_size/1024/1024/1024 AS pool_gb, @@innodb_log_file_size/1024/1024 AS redo_mb, @@max_connections, @@slow_query_log, @@slow_query_log_file;"
Every value matches the file. A value that still shows the old default means the file never got read, usually because of a typo in the section header or a file name that does not end in .cnf.
pool_gb redo_mb @@max_connections @@slow_query_log @@slow_query_log_file
2.000000000000 512.00000000 200 1 db-trixie-slow.log
The slow log lands in /var/lib/mysql, named after the host, and it is the first file to read when an application gets slower. The buffer pool also resizes live, which helps when you find the right size by watching the server rather than guessing up front:
sudo mariadb -e "SET GLOBAL innodb_buffer_pool_size = 1536*1024*1024; SELECT @@innodb_buffer_pool_size/1024/1024 AS pool_mb;"
The pool shrank to 1.5 GB without a restart. Growing it works the same way, as long as the host has the free memory.
pool_mb
1536.00000000
A live change lasts only until the next restart, so copy the size you settle on into the tuning file. For a quick pulse between dashboard checks, sudo mariadb-admin status prints uptime, threads, slow queries and queries per second on one line.
Back up the database
Two tools cover most needs, and you will probably want both:
- mariadb-dump for small databases and moves between versions
- mariadb-backup for large databases and fast restores
mariadb-dump writes logical SQL. It is slow on big databases because every row becomes an INSERT statement, but the file restores anywhere, even into another major version. Start with that one.
sudo mariadb-dump --single-transaction --routines --triggers appdb | gzip > /tmp/appdb-$(date +%F).sql.gz
ls -lh /tmp/appdb-*.sql.gz
Our small test database compressed to under a kilobyte.
-rw-r--r-- 1 josphat josphat 847 Nov 14 04:21 /tmp/appdb-2026-11-14.sql.gz
mariadb-backup copies the data files while the server keeps running, which is what you want past a few gigabytes. It will not create the parent of its target directory, a mistake that cost us one run with Error: cannot mkdir 2, so create that first:
sudo mkdir -p /var/backups/mariadb
sudo mariadb-backup --backup --target-dir=/var/backups/mariadb/full-$(date +%F)
sudo mariadb-backup --prepare --target-dir=/var/backups/mariadb/full-$(date +%F)
Both steps should end with completed OK!. These are the last lines of each on our Debian 12 server:
[00] 2026-11-14 04:22:47 Redo log (from LSN 45552 to 49162) was copied.
2026-11-14 4:22:47 0 [Note] InnoDB: Starting shutdown...
[00] 2026-11-14 04:22:47 completed OK!
2026-11-14 4:22:48 0 [Note] InnoDB: Starting shutdown...
recovered pages: 0% 28% 39% 71% 81% 92% 100% (0.0 seconds); tables to flush: 2 1 0 (0.0 seconds);
[00] 2026-11-14 04:22:48 completed OK!
The prepare step applies the redo log so the copy is consistent, and a backup you have not prepared is not ready to restore. Copy the directory off the host afterwards, because a backup on the same disk dies with it. Point-in-time recovery with binary logs on top of this is covered in our guide to PostgreSQL and MariaDB backup with point-in-time recovery.
Fix the errors we hit
Each of these came up during our runs on Debian 13 and Debian 12, either by accident or while checking how a mistake looks. They fall into three groups:
- Repository errors that stop
apt update - SQL errors from the new 12.3 features
- A backup path mistake
The exact error text is in each heading, so you can match it against your own terminal.
The repository ‘https://deb.mariadb.org/12.0/debian trixie Release’ does not have a Release file
The 12.0 repository is gone from MariaDB’s mirror network. apt follows the redirect to mirror.mariadb.org and gets a 404, so apt update fails for the whole run, not just for MariaDB:
Err:10 https://mirror.mariadb.org/repo/12.0/debian trixie Release
404 Not Found [IP: 203.0.113.10 443]
Error: The repository 'https://deb.mariadb.org/12.0/debian trixie Release' does not have a Release file.
Point the URIs line at 12.3 and run sudo apt update again. Do not go hunting for another 12.0 mirror, since the line has had no release since August 2025. Even if you found one, you would be installing a build that gets no more security fixes, so treat the 404 as the push to upgrade.
Failed to parse keyring “/etc/apt/keyrings/mariadb.gpg”
apt can’t find the file named in Signed-By. We reproduced it by pointing the line at mariadb.gpg while the key was saved as mariadb-keyring.asc:
Err:7 https://mirror.mariadb.org/repo/12.3/debian trixie InRelease
Sub-process /usr/bin/sqv returned an error code (1), error message is: Error: Failed to parse keyring "/etc/apt/keyrings/mariadb.gpg" Caused by: 0: Reading "/etc/apt/keyrings/mariadb.gpg": No such file or directory (os error 2) 1: No such file or directory (os error 2)
The path in the .sources file has to match the downloaded file exactly, extension included. The .asc key works as it is, so there is no need to convert it with gpg.
ERROR 2006 (HY000): Server has gone away after INSTALL SONAME ‘auth_mysql_sha2’
The server kept running in our case, and it was only the connection that died. The plugin aborted the connection because its RSA key pair did not exist yet, and the journal shows failed to read private_key.pem. Restart MariaDB once and the keys get generated at startup.
ERROR 1873 (28000): Access denied trying to change to user
The session running SET SESSION AUTHORIZATION lacks the SET USER privilege. Grant it to the account doing the switch, as shown in that section. Keep it off application accounts, because anyone holding it can become any other user, so a leaked application password would turn into full access.
ERROR 1568 (25001): SESSION AUTHORIZATION can’t be set while a transaction is in progress
Commit or roll back first, then switch. In scripts, put the SET SESSION AUTHORIZATION line at the very start of the session, before the first statement that touches data, so there is never an open transaction in the way.
Error: cannot mkdir 2: /var/backups/mariadb/full-2026-11-14/
mariadb-backup creates only the last directory in the target path, and errno 2 means the parent is missing. Create it with sudo mkdir -p /var/backups/mariadb and run the backup again. If the backup runs from cron, put the mkdir -p in the same script, so a cleaned-up backup volume does not break the next night’s run.
Where we’d run MariaDB 12.3
On a new Debian server we’d install 12.3 from MariaDB’s repository and nothing else. It is the long-term line with the most runway, the repository setup is short enough to audit in a minute, and every 12.x feature from the rolling releases is in it, so nothing you tested on 12.0 goes away. The case for Debian 13’s own 11.8 is a fleet where you’d rather take database updates from Debian security than track another vendor’s repository. Anyone on 12.0 should move now, because the upgrade is ten packages and a restart. If you’re newer to running MariaDB day to day, our pick of MySQL and MariaDB books covers the administration side this guide only touches.