Try to do a
select max(auto_inc_col) from tablename
Usually reaching the max value of the datatype, mysql may truncate to the max value and you got a duplicate key error.
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --