-- 查看表中自增长列的当前值(数据库名:park_jar,表名:cap_ammeter_detail_201906)
SELECT
Auto_increment
FROM
information_schema.`TABLES`
WHERE
Table_Schema = 'park_jar'
AND table_name = 'cap_ammeter_detail_201906'; -- 设置,注意,要比当前值大,如果要设置比当前值小的话,要删除相应的数据 ALTER TABLE park_jar.cap_ammeter_detail_201906 AUTO_INCREMENT = 1;