Not the answer you need?
Register and ask your own question!

Xtrabackup 2.4 always says "file not found" when given --defaults-file

AlexHallAlexHall Current User Role Novice
I'm brand new to Xtrabackup, but my work needs transactional backups for production MySQL, so here we are.

I'm trying to get a test database to back up. I have a simple shell script that puts some paths in variables, then tries to run the command. The username, password, and port (we're not using 3306) are all in a separate file. Every time I run the backup, I'm told the defaults file is not found.

I'm running all this as the backup user. Thus:

nano /etc/mysql/backup_creds.cnf

chown mysqlbackup:mysqlbackup /etc/mysql/backup_creds.cnf
chmod 600 /etc/mysql/backup_creds.cnf #I've tried 700 and 777 as well
sudo -u mysqlbackup /etc/mysql/
/etc/mysql/ 6: /etc/mysql/ --defaults-file=/etc/mysql/backup_creds.cnf: not found   

I should also say that this server is running 5.7 and 8.0. I've therefore installed xtrabackup 2.4 from source, and will soon do the same for 8.0. The shell script defines the path to the executable rather than using the normal "xtrabackup" command. Oh, and I've checked the permissions: execute is allowed for user, group, and other from / all the way to backup_creds.cnf, so the user should be able to get to the file. That said, I get an identical error even with the .cnf file set to 777.

I'm completely stuck, and have no idea what to try next. It seems like a permissions problem, but I can't figure out where the bad permission is set. I don't even know for sure that I'm on the right track. Let me know what other details I should add, if any. Thanks for any suggestions.


  • AlexHallAlexHall Current User Role Novice
    Never mind, figured it out. It was a syntax error in the shell script not severe enough to cause an error in Bash, but enough to cause problems when the script was executed. I've got it now.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.