I am attempting to upgrade MySQL from 5.6 to 5.7 and everything seems to be working, but when I try to run xtrabackup I am now getting this error:

InnoDB: Allocated tablespace ID 12 for percona/checksums, old maximum was 0
InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to the directory.
xtrabackup: error: xb_load_tablespaces() failed witherror code 11

Nothing has changed, mysql user perms, system user perms, directory perms, nor structure, but now I am seeing this error. I cannot replicate the problem when I run the command as root, so it leads me to believe it is a system permission issue.

I temporarily disabled selinux to remove it as a distractor. I also granted ALL to the databacker mysql user in case it was a new permission that I was missing.

Here is the command I use:

su -s /bin/bash databacker -c "innobackupex --user=databacker --password=p4ssw0rd --socket=/var/lib/mysql/mysql.sock --stream=tar /tmp | gzip - > /tmp/wtf.tgz"

I tested perms as the databacker user and it all seems to work as expected:

su -s /bin/bash databacker -c "cd /tmp && touch test.txt"
su -s /bin/bash databacker -c "cd /var/lib/mysql && touch test.txt"

What am I missing?

  • Have you followed their documentation? link. Also note: As files’ attributes will be preserved, in most cases you will need to change the files’ ownership to mysql before starting the database server, as they will be owned by the user who created the backup: $ chown -R mysql:mysql /var/lib/mysql – KXNV-89.1FM Jun 21 '17 at 17:55
  • Your 2nd and 3rd InnoDB error messages could also be due to the fact that you have created a subdirectory of the same name as a data file. – KXNV-89.1FM Jun 21 '17 at 18:23
  • Consider building from source, after adding your own debugging statements. (That's one advantage to open source software, eh?) There's also this: "Debugging mysqld under gdb" link to get more information when mysqld crashes. And this: "Compiling MySQL for Debugging" link BTW my comment above this one was made after I examined the source code. Take a look at the source--you may find what you are looking for. – KXNV-89.1FM Jun 26 '17 at 7:10
  • In my previous comment, I should have explicitly referred to xtrabackup when I stated "Consider building from source" and "Take a look at the source." And that my mention of debugging mysqld under gdb and compiling MySQL for debugging were intended as an "Oh, BTW" for the general case. – KXNV-89.1FM Jun 26 '17 at 18:17

I had a similar issue with an upgrade where I ended up with mixed libraries. Make sure you don't have dated library files still out there. I had to completely uninstall MySQL and reinstall it from scratch, and then it worked.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.