fix(backup): force TCP for mariadb-dump to match '<user>'@'%' grant

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-26 00:46:47 +02:00
parent bfa596ae30
commit ad5d8fcda3
3 changed files with 213 additions and 0 deletions

View File

@@ -115,8 +115,10 @@ def backup_database(
dump_file = os.path.join(out_dir, f"{db_name}.backup.sql")
if db_type == "mariadb":
# Force TCP so auth matches '<user>'@'%' instead of socket -> 'localhost'.
cmd = (
f"docker exec {container} /usr/bin/mariadb-dump "
f"-h 127.0.0.1 --protocol=tcp "
f"-u {user} -p{password} {db_name}"
)
_atomic_write_cmd(cmd, dump_file)