Harvester query to identify databases where the ID has reset I need a MySQL query to identify if a database has a table where the auto-incremented ID has reset back to 0. This can result in non-unique rows for those IDs. I'm not sure how to write this. Thanks in advance for any help!
A_I does not go back to zero; it hits the max for the datatype and then is stuck there.  This leads to errors on INSERT that you should be checking for.

This will get you the SELECTs necessary to do the investigation:

SELECT  CONCAT("SELECT  MAX(", column_name, ") AS max_id, '", data_type, "' AS type, ", (column_type LIKE '%unsigned%'), " AS 'unsigned'  FROM  ", table_schema, ".", table_name, ";"
              ) AS stmts
    FROM information_schema.`COLUMNS`
    WHERE extra LIKE '%auto_increment%' ;


Sample row:

 SELECT MAX(AId) AS max_id, 'int' AS type, 1 AS 'unsigned'  
 FROM alerts.action;


Running that sample gets:

+--------+------+----------+
| max_id | type | unsigned |
+--------+------+----------+
|      4 | int  |        1 |
+--------+------+----------+


The next step is to understand that int unsigned has a max of 2^32-1, and compare that to the 4.

All of this could be done in a long stored procedure, or in some application code (I leave that as an exercise to the reader).