0
votes

I followed this link to restore my backup https://cloud.google.com/sql/docs/mysql/backup-recovery/restoring

and i've tried restoring on multiple instances too

but in every instance's this error comes up in logs

Couldn't repair table: mysql.general_log Failed to write to mysql.general_log: Incorrect key file for table 'general_log'; try to repair it

1

1 Answers

0
votes

First, address the error. Your general query log is enabled, but the install default is disabled. If you do not need the table enabled, then once everything is working, disable it. I would suggest take a fresh backup and then:

A. Repair the table using the mysqlcheck -r YourDB general_log command. (If this is an ISAM table use myisamchk instead.)

B. If that does not repair the table, first try mysqlcheck -r YourDB to repair the whole database (sometimes more than just the table needs to be repaired.)

C. If the restore still doesn't work than there are a couple of possibilities: the database may be corrupted or the backup file is corrupted. You don't mention any other errors, so I do not suspect the whole database is corrupted.

D. To check on the corrupted file, you can create a fresh database instance and try your restore there. If that does not work you can try restoring a data table to confirm if the backup file is usable.

Be prepared for the possibility your backup file is corrupt.