Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I recent took a backup using mysqlbackup.

While restoring it, I noticed that the files that were copied into datadir are with root:root (user:group) instead of mysql:mysql.

Is anything wrong with taking backup or what?....

share|improve this question

1 Answer 1

Since it is a backup, you are right to be concerned with whether it can be restored or not.

To be on the safe side, you must run

chown -R mysql:mysql /var/lib/mysql

immediately after the backup so mysql doesn't barf when restoring it.

Otherwise, you may get an OS error concerning file permission during the restoration or mysql startup

[root@******* 20130101_000]# perror 13
OS error code  13:  Permission denied
share|improve this answer
    
My concern is after a successful restore into datadir.....user:group is root:root so does the privileges with 644 instead of 660 for frm ibd myd files. Is it that usually happens with mysqlbackup or do I need to use any options for it. –  Vinay Jan 5 '13 at 5:08
    
One thing is certain: mysqld will not operate with files whose is not mysql:mysql so run the chown -R mysql:mysql as I specified. –  RolandoMySQLDBA Jan 5 '13 at 5:20
    
Ok thanks for clarifying.....all I was thinking is that I'm not using right commands.... –  Vinay Jan 5 '13 at 5:48
    
You're not doing anything wrong, but you will have to change the permissions like Rolando suggested. The MySQL Enterprise Backup Documentation indicates in its "Limitations" section that "upon restore, these files might have different ownership, for example being owned by root rather than mysql". Not sure why that's not more clearly described in their documentation about doing a restore - you'd think that just about everyone would run into that problem. –  Nathan Jolly May 5 '13 at 2:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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