Xtrabackup - Failed to connect to MySQL server: SSL connection error: unknown error number

I want to backup a mysql cluster (version 5.7.33-36) using xtrabackup (everything runs on kubernetes). I have a pod that has xtrabackup 2.4 installed, but when I run the command xtrabackup --user=root --password=<password> --host=mysql.<namespace> --port=3306 --backup --target-dir=/tmp I get the error Failed to connect to MySQL server: SSL connection error: unknown error number.
I have also tried the options --ssl-mode=DISABLED, --ssl=FALSE, --initialize-insecure, --skip-ssl, --skip-networking but nothing seems to work, every time I try I get the same error. If I try with the command mysql -u root -p<password> -h mysql.<namespace> I can connect to mysql without problems.

1 Like

Hi Matias,

The version of xtrabackup you are running is old. For MySQL 5.7 you should be using 2.4 series (as the opposite of 2.2).

Also, another thing to have in mind is that xtrabackup needs physical access to the database files, meaning you need to run it on the same pod/instance as the database.

2 Likes

Sorry, it was a typo. I have version 2.4 installed, the most recent one. Isn’t there a way to backup from another pod as mysqldump allows?

1 Like

No, there is no such way. XtraBackup performs a physical backup of the database files, therefore needs physical access to the data directory. mysqldump just connects over the network like any other MySQL client, therefore it can backup data from the remote server.

1 Like

I was wondering how is it that the scheduled backups work, because when they run, it runs a pod that supposedly executes the backup, how does it work if it is a new pod? Isn’t it supposed to be done from a place that has physical access to the data? how does it get physical access to the data?

1 Like

K8PXC operator stores data in the persistentVolumeClaim, so the pod can be setup to access it.

1 Like