I saw the same error message on a table with a bigint(20) key and looking at the output of
mysql>show table status like 'my_big_table';
when it should have been:
(as the last row inserted had a key value of 2157452850)
There was no explanation of why the Auto_increment went to a value of 0 but it blocked inserts by our application.
I tried to do the
ALTER TABLE to change the Auto_increment value, but it was apparent that the entire table was going to be rebuilt, which on a table this size would have taken many hours, so I canceled the alter.
The solution I found was to explicitly add a row with the next key value:
mysql> INSERT INTO `my_big_table` VALUES (2157452851,22808084,71,36376,'2013-03-16 15:09:55','2013-03-16 15:07:18','2013-03-16 15:09:55','Sent',NULL,7426);
Query OK, 1 row affected (0.03 sec)
This corrected the Auto_index value.
mysql> show table status like 'my_big_table'\G
Hopefully this will help someone else.