3

We backup a database daily with mysqldump using the following options:

--quick --hex-blob --lock-tables --skip-extended-insert  --flush-logs --max_allowed_packet=500M

Each database gets its own directory and that directory has a .sql file for each table in the database.

I recently tried to do a test restore and I get the following error over and over for each table in the .sql file I try to import:

ERROR 1017 (HY000): Can't find file: './WhateverTableIQuery.frm' (errno: 13)

The .frm files are indeed on the source machine but all I'm getting in the backup is tarballs of .sql files.

Am I doing the backup wrong or the restore wrong?

4
  • You mentioned that each table has a .sql file! Are you doing backup for each table by itself? Normally, each DB would have its own .sql file, or all DBs in one file. Verify that please then we go futher Jan 5 '16 at 16:19
  • there is an sql file per table, per database. there are about 70 databases on the server. Jan 5 '16 at 17:43
  • What is the full mysqldump command with its options and output redirection? Jan 5 '16 at 18:33
  • Also, make sure please that WhateverTableIQuery is an actual table, not a view It could be that you're generating a backup of a view. Jan 5 '16 at 18:35
2
$ perror 13
OS error code  13:  Permission denied

Fix the permissions so that "mysql" can read the file. Keep in mind that the OS 'root' and the mysql 'root' are not the same.

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.