PERCONA MYSQL ERROR Error Code: 1034. Incorrect key file for table

saloaunsaloaun EntrantActive Member Participant
im trying to import a table after partial backup or full with percona 8.0 and im having problems with only 1 table, the size of the table = 14 GB. im doing the steps following all oficial forums:
  1. full backup: xtrabackup --backup --datadir=/var/lib/mysql --target-dir=/backup/ --parallel=4 --user='root' --password='pass' --no-timestamp
  2. create table with same structure no data.
  3. SET FOREIGN_KEY_CHECKS=0;
  4. alter table mytable discard tablespace;
  5. cp mytable.ibd /var/lib/mysql/database/ & chown -R mysql:mysql /var/lib/mysql/db/mytable.ibd
  6. SET FOREIGN_KEY_CHECKS=0;
  7. alter table mytable import tablespace;
after all this steps i got this error:
Error Code: 1034. Incorrect key file for table 'mytable'; try to repair it
and in mysql.log i got:
[MY-012762] [InnoDB] Page offset doesn't match file offset: page offset: 262144, file offset: 262144
i only get the error some tables, if i restore full backup with --copy-back all tables are OK!
what can i do? i tried increase change directory /tmp in my.cnf but nothing work.

Comments

  • jriverajrivera Percona Support Engineer Percona Advisor

    Are you going to use one of the tables from the backup taken in step 1? If so then I believe you are missing a step to execute --prepare --export. See this link for further guidance: https://www.percona.com/doc/percona-xtrabackup/8.0/xtrabackup_bin/restoring_individual_tables.html

  • saloaunsaloaun Entrant Active Member Participant

    Hi mate, i did the same follow --prepare --export and i copy the file ibd to mysql location but after import tablespace i got the same error:

    [ERROR] [MY-012762] [InnoDB] Page offset doesn't match file offset: page offset: 262144, file offset: 262144

    and

    Error Code: 1034. Incorrect key file for table 'mytable'; try to repair it

  • saloaunsaloaun Entrant Active Member Participant

    Hi mate, i did the same follow --prepare --export and i copy the file ibd to mysql location but after import tablespace i got the same error:

    [ERROR] [MY-012762] [InnoDB] Page offset doesn't match file offset: page offset: 262144, file offset: 262144

    and

    Error Code: 1034. Incorrect key file for table 'mytable'; try to repair it

Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.