之前沒注意MySQL的這個知識點,查了一下這個需要配合zerofill使用
CREATE TABLE `test2` (
`id` int(11) NOT NULL,
`int5` int(5) unsigned zerofill DEFAULT NULL,
`int6` int(6) unsigned zerofill DEFAULT NULL,
`desc` int(5) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
參考資料:https://blog.csdn.net/samll_snail/article/details/86534719