Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5.2
-
None
Description
I'm trying to setup a Kubernetes CronJob to backup a MariaDB Pod using mariadb-backup.
Since mariadb-backup needs to physically copy the database files, the CronJob Pod mounts the same PersistentVolume as the MariaDB server Pod under /mnt/mariadb.
When I run the backup command, though, it just hangs forever with the following message:
[00] 2026-02-09 13:30:55 Connecting to MariaDB server host: my-db.mariadb.svc.cluster.local, user: myuser, password: set, port: 3306, socket: /run/mysqld/mysqld.sock
The command is the following:
mariabackup --backup --datadir /mnt/mariadb --host ${DB_HOST} --port ${DB_PORT} --user ${DB_USER} --password=${DB_PASSWORD} --databases "${database}" --compress --target-dir /mnt/backups/full
The mariabackup command works as expected if run on the MariaDB server Pod with the same parameters.
The MariaDB server Pod is reachable from the CronJob Pod using the mariadb client with the same parameters.
Since mariadb-backup has the --host option, I'd expect it to behave the same way as the mariadb client. That is, if a remote host is specified it will attempt a TCP connection instead of using the local socket.
This behaviour makes it impossible to use mariadb-backup in a Kubernetes environment. The only alternative is a logical database dump, which is impractical for large databases.