On many of our clients, we have a need to run XtraBackup as a regular OS user. Aside from running into the issue where tar4ibd was not provided with Percona’s xtrabackup-1.6.2.tar.gz package, our main issues have been with permissions when attempting a streaming backup.
I have found the following:
- The user needs permissions for a temp directory to stream to/from. The my.cnf of the target database cannot be used because the user does not have permission to write to /tmp/mysql-stdout, so we set a tmpdir in a separate defaults-file.
- A backup target directory must be used that the user has read/write permissions to. It seems to me a target directory should not be needed for a streaming backup, but it is.
- A user who has SUPER privileges must be used to connect to the target database.
- Group and datadir permissions:
- The primary group for the user should be the same as the mysql user running the target database, i.e. pythian:mysql.
- The user must have 770 access to the database schema directories.
- The user must have 740 access to the all files under the mysql datadir.
Here is the innobackupex command that works for us.
$ innobackupex --defaults-file=/home/pythian/my.cnf --user=root --stream=tar ./ | gzip - > /home/pythian/backups/2011-08-02_backup.tar.gz
So if you are seeing errors such as,
tar: -: Cannot write: Broken pipe sh: /tmp/mysql-stout: Permission denied
do yourself a favor and run through this permission checklist. I hope it saves a lot of headaches.
Share this
You May Also Like
These Related Stories
Migration and Upgrade from EC2 to RDS Using DBMS_FILE_TRANSFER
Migration and Upgrade from EC2 to RDS Using DBMS_FILE_TRANSFER
Sep 13, 2021
3
min read
Getting started with Oracle Database Backup Service in 2018
Getting started with Oracle Database Backup Service in 2018
Aug 3, 2018
7
min read
Methodology for Snowflake Role-Based Access Control
Methodology for Snowflake Role-Based Access Control
Sep 14, 2021
6
min read
No Comments Yet
Let us know what you think