这简直就是一个“定时炸弹”!记一次 MySQL 的奇葩故障
ERROR 1062 (23000): Duplicate entry '2147483647' for key 'PRIMARY'分析
mysql> select * from t2 order by id desc limit 3;
+------------+------+------+
| id | c1 | c2 |
+------------+------+------+
| 2147483647 | 101 | 101 |
| 100 | 100 | 100 |
| 4 | 4 | 4 |
+------------+------+------+
3 rows in set (0.00 sec)
mysql> show create table t2\G
*************************** 1. row ***************************
Table: t2
Create Table: CREATE TABLE `t2` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`c1` int(11) DEFAULT NULL,
`c2` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_c1` (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=2147483647 DEFAULT CHARSET=utf8mb4
1 row in set (0.00 sec)小结
Last updated