Xtrabackup 2.4 expecting "c:\mysqldata\" directory in my linux server though am using "--target-dir=/mysqldata" in the command

sudo xtrabackup --backup --user=clouddbadmin@myhost --password=‘******’ --host=myhost.mysql.database.azure.com --port=3306 --target-dir=/mysqldata

230411 16:42:52 version_check Connected to MySQL server
230411 16:42:52 version_check Executing a version check against the server…
230411 16:42:52 version_check Done.
230411 16:42:52 Connecting to MySQL server host: myhost.mysql.database.azure.com, user: clouddbadmin@myhost, password: set, port: 3306, socket: not set
Using server version 5.7.32-log
xtrabackup version 2.4.28 based on MySQL server 5.7.40 Linux (x86_64) (revision id: 44a8f7b)
xtrabackup: uses posix_fadvise().
xtrabackup: Can’t change dir to 'c:\mysqldata' (Errcode: 2 - No such file or directory)
*xtrabackup: cannot my_setwd c:\mysqldata*

Hi @Hadi_Shamil .

It seems like you are trying to backup a windows server (where MySQL is running) from a Linux server (where xtrabackup is running)

xtrabackup requires direct access to running MySQL datadir, so you must run it on the same server MySQL is running.

Hi @Marcelo_Altmann ,

I am trying to backup from my Azure Database for MySQL servers (DBaaS) which is a remote host from my Linux server where xtrabackup is running.

How do I achieve it?

In that case, you will have to either use Azure backup functionality or run a logical backup.

For logical backups have a look in mydumper or mysqldump

1 Like