Chris Barnes wrote:

>i use mysql --user=whoever --password=whatever --host=whereever <
>dabase_backup.txt
>all is well so it seems but its actually not...i keep getting the error
>"Error 1062 at line 3: Duplicate entry '1' for key 1
>  
>

I suspect this is actually the problem with isamchk as well. If you look 
at the options it says:

  -r, --recover       Can fix almost anything except unique keys that aren't
                      unique.

I don't know exactly how easy it is to fix because I stopped using mysql 
some time ago. You shouldn't have to drop the whole table though. Try 
doing "delete from <table> where <id> = 1". That may not work because 
it's a primary key and could conceivably whinge on its internal 
consistency checks. So if that fails try changing your id field so that 
it is no longer a key. Unfortunately I can't remember how to do this, 
but I seem to recall that mysql has less issues making your key fields 
keys again after a modification like that. Also, you might want to use 
mysqldump for your backups.

Alternatively, run your backup script but modify the query that gets the 
info from this table to exclude that row and rebuild the database from that.

HTH,

James.

-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to