Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2001

    Restoring a mySQL database - please help

    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!

  2. #2
    Join Date
    Jan 2002
    Melbourne, AU
    Sounds like you haven't dropped all the tables before starting the restore.


  3. #3
    I assume one of the colum has been defined as a primary key, in which you have a dupicated value in you backup data.

  4. #4
    Join Date
    Aug 2002
    down under


    This can sometimes be caused by corrupt index tables (the .MYI files). Try running myisamchk first on those indices:

    cd /path/to/database/dir
    myisamchk *.MYI

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts