# Xtrabackup 8.0 error

**URL:** <https://forums.percona.com/t/xtrabackup-8-0-error/13802>\
**Category:** Percona XtraBackup\
**Created:** [January 5, 2022, 9:06pm UTC](https://forums.percona.com/t/xtrabackup-8-0-error/13802 "2022-01-05T21:06:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![danarashad](https://avatars.discourse-cdn.com/v4/letter/d/7ab992/32.png) [@danarashad](https://forums.percona.com/u/danarashad)\
**Post date:** [January 5, 2022, 9:06pm UTC](https://forums.percona.com/t/xtrabackup-8-0-error/13802/1 "2022-01-05T21:06:14Z")

</div>

I am switching from PXC 5.6 to PXC 8.0. The new 8.0 cluster is up I am working on a backup script. But I am running into errors.

```auto
xtrabackup --defaults-file=/etc/mysql/mysql.conf.d/mysqld.cnf --defaults-group=mysqld --socket=/var/run/mysqld/mysqld.sock --user=root --password=$pwd_value --backup --stream=xbstream --compress --target-dir=$dest 2> $log | gzip - | ssh mysql@backupserver "cat - > /data/mysql/$dest_folder/$backup_file" > /dev/null 2>&1

```

Here is the error

```auto
xtrabackup: cd to /db1
xtrabackup: open files limit requested 0, set to 1024
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = .
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
Number of pools: 1
xtrabackup: inititialize_service_handles suceeded
Operating system error number 13 in a file operation.
The error means mysqld does not have the access rights to the directory.

```

I am unsure why mysqld doesn’t have the rights. Rights to which directory and how do i fix the issue?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [January 6, 2022, 3:13pm UTC](https://forums.percona.com/t/xtrabackup-8-0-error/13802/2 "2022-01-06T15:13:03Z")

</div>

Make sure you are using xtrabackup v8 and not any previous version. Also make sure the OS user that you are logged in as has permissions to read the data files. The error message is a bit misleading. You may need to `sudo` to root before running xtrabackup.

---

<div class="post-metadata">

**Author:** ![danarashad](https://avatars.discourse-cdn.com/v4/letter/d/7ab992/32.png) [@danarashad](https://forums.percona.com/u/danarashad)\
**Post date:** [January 25, 2022, 6:34pm UTC](https://forums.percona.com/t/xtrabackup-8-0-error/13802/3 "2022-01-25T18:34:57Z")

</div>

Do I need to stop mysql to change datadir permissions?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [January 25, 2022, 7:18pm UTC](https://forums.percona.com/t/xtrabackup-8-0-error/13802/4 "2022-01-25T19:18:28Z")

</div>

No, you don’t. Just to clarify, MySQL’s datadir and all files inside should be owned and grouped by `mysql` OS user. You need to run xtrabackup as either A) `mysql` OS user, or B) `root` OS user to read the files in the MySQL datadir.

---

<div class="post-metadata">

**Author:** ![danarashad](https://avatars.discourse-cdn.com/v4/letter/d/7ab992/32.png) [@danarashad](https://forums.percona.com/u/danarashad)\
**Post date:** [January 25, 2022, 7:26pm UTC](https://forums.percona.com/t/xtrabackup-8-0-error/13802/5 "2022-01-25T19:26:36Z")

</div>

All files are owned by mysql user. Thanks for the information.
