Failed to connect error when trying to backup XtraDB Cluster Node

Hi all,

I’m doing some testing with a Percona XtraDB Cluster and I am attempting to use XtraBackup to create a backup of one of the nodes. The XtraDB Cluster is running on a Docker Swarm and I am following the documentation to run XtraBackup on Docker. I made sure to run the XtraBackup container on the same host as the cluster node I am trying to back up.

Docker create command:

sudo docker create --name percona-xtrabackup --volumes-from db_pxc1.1.ylosyqc7kjeqzwm32ieif6qs3 percona/percona-xtrabackup xtrabackup --backup --datadir=/var/lib/mysql/ --target-dir=/backup --user=root --password=password

Error when running container:

$ sudo docker start -ai percona-xtrabackup
2026-03-31T00:27:36.993435-00:00 0 [Note] [MY-011825] [Xtrabackup] recognized server arguments: --datadir=/var/lib/mysql/
2026-03-31T00:27:36.993516-00:00 0 [Note] [MY-011825] [Xtrabackup] recognized client arguments: --backup=1 --target-dir=/backup --user=root --password=*
xtrabackup version 8.0.35-35 based on MySQL server 8.0.35 Linux (x86_64) (revision id: be447639)
2026-03-31T00:27:36.995772-00:00 0 [Note] [MY-011825] [Xtrabackup] perl binary not found. Skipping the version check
2026-03-31T00:27:36.995801-00:00 0 [Note] [MY-011825] [Xtrabackup] Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: not set
2026-03-31T00:27:36.995856-00:00 0 [ERROR] [MY-011825] [Xtrabackup] Failed to connect to MySQL server: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Any suggestions would be appreciated. Thanks!

Hey,

Did you try specifying --host parameter? Or should you use a socket file.

Let us know how it goes.

1 Like