简体   繁体   English

Mysql 行数与最后输入的值不匹配

[英]Mysql row count doesn't match last value entered

Am having an interesting problem with mysql. mysql 有一个有趣的问题。 I have a table set with the primary key being an auto increment.我有一个表集,主键是自动增量。 Recently i made a mistake and had to manually add in 18 records using phpmyadmin as opposed to doing it through the website.最近我犯了一个错误,不得不使用 phpmyadmin 手动添加 18 条记录,而不是通过网站进行。 Now whats happenend is that there is a discrepancy between what mysql says is the number of records in the table and the last id.现在发生的事情是 mysql 所说的表中的记录数和最后一个 id 之间存在差异。 Meaning, mysql says there 6935 records in the table, however the last entry in the table has an id of 6917, the extra 18 records that mysql is counting do not exist anywhere.意思是,mysql 表示表中有 6935 条记录,但表中的最后一个条目的 id 为 6917,mysql 计算的额外 18 条记录在任何地方都不存在。 Does anyone know what the problem is?有谁知道问题是什么? Is this a mysql bug or did I mess up somewhere?这是 mysql 错误还是我在某个地方搞砸了?

As the id column is auto_increment, if you delete records there will be gaps.由于 id 列是 auto_increment,如果你删除记录会有间隙。

no there are no bugs in mysql..不,mysql 中没有错误。

1) you should first check whether data are entered or not. 1)您应该首先检查是否输入了数据。

2) you need to check whether any data that are deleted from table or not..in short you need to check for all auto inc. 2)您需要检查是否从表中删除了任何数据。简而言之,您需要检查所有汽车公司。 data.. is it started from 1 and is it in sequence?数据..它是从1开始的吗?它是按顺序排列的吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM