Home > Backend Development > PHP Tutorial > Mysql主键自增长的有关问题

Mysql主键自增长的有关问题

WBOY
Release: 2016-06-13 12:42:50
Original
904 people have browsed it

Mysql主键自增长的问题
是这样的,简单的mysql表,id是主键,且自增长。

id  value<br />
1    ok<br />
2    good
Copy after login


现在我把上面两条记录删除,整个表是一个空表了,然后我再加一条记录(直接填值,不指明主键)。

他就变成了:
id  value<br />
3   new
Copy after login


id从3开始了,前面id记录被我删除了,他的id怎么从3开始呢,这个是有什么意义?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template