mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2026-06-05 03:12:13 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user