mysql> describe warehouse_orders_products; +--------------+------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+------------+------+-----+---------+----------------+ | wo_id | int(15) | | PRI | NULL | auto_increment | | orders_id | bigint(20) | YES | | NULL | | | products_id | int(11) | YES | | NULL | | | qty1 | int(11) | YES | | NULL | | | qty2 | int(11) | YES | | NULL | | | qty3 | int(11) | YES | | NULL | | | warehouse_id | int(11) | YES | | NULL | | | qty4 | int(11) | YES | | NULL | | +--------------+------------+------+-----+---------+----------------+ 8 rows in set (0.00 sec) mysql> insert into warehouse_orders_products(orders_id,products_id,qty1,warehouse_id) values('70829730406','50','3','1'); ERROR 1062: Duplicate entry '2147483647' for key 1 mysql> select * from warehouse_orders_products ORDER BY wo_id DESC limit 5; +------------+-------------+-------------+------+------+------+--------------+------+ | wo_id | orders_id | products_id | qty1 | qty2 | qty3 | warehouse_id | qty4 | +------------+-------------+-------------+------+------+------+--------------+------+ | 2147483647 | 70828738790 | 63 | 2 | NULL | NULL | 1 | NULL | | 2147483646 | 70828738790 | 58 | 8 | NULL | NULL | 1 | NULL | | 2147483645 | 70828738790 | 54 | 4 | NULL | NULL | 1 | NULL | | 2147483644 | 70828738790 | 53 | 2 | NULL | NULL | 1 | NULL | | 2147483643 | 70828738790 | 48 | 2 | NULL | NULL | 1 | NULL | +------------+-------------+-------------+------+------+------+--------------+------+ mysql> ALTER TABLE warehouse_orders_products AUTO_INCREMENT=0 -> ; Query OK, 582127 rows affected (3.15 sec) Records: 582127 Duplicates: 0 Warnings: 0 mysql> insert into warehouse_orders_products(orders_id,products_id,qty1,warehouse_id) values('70829730406','50','3','1'); ERROR 1062: Duplicate entry '2147483647' for key 1