Hello. I have a mySQL database and I take daily backups with mysqldump. I restored the database some times but the last one (today) I get errors. I give the command "mysql -p database < database.sql" but it returns me the following error:
Error 1062 at line 777: Duplicate entry '34048-30284' for key 1
How can I fix it? A quick answer would be really appreciated! Thank you!
This can sometimes be caused by corrupt index tables (the .MYI files). Try running myisamchk first on those indices:
Alternatively, if you are sure that your backup contains the correct and up to date data, you can simply drop the current table, recreate it, and fill the new empty table with the data from the backup.