我可以重置mySql中的auto_increment字段吗? [英] can I reset auto_increment field in mySql?

查看:101
本文介绍了我可以重置mySql中的auto_increment字段吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以重置MySQL表的自动增量索引,使其从零开始重新计数吗?

Can I reset the auto-increment index of a MySQL table so that it starts counting from zero again?

我删除了表格中的所有行-如何也可以重置该计数器?

I deleted all the rows in the table--how can I reset that counter as well?

推荐答案

要从MySQL表中删除所有行并重置auto_increment值,请使用truncate命令.

To delete all rows from a MySQL table AND reset the auto_increment value, use the truncate command.

http://dev.mysql.com/doc /refman/5.7/en/truncate-table.html

这篇关于我可以重置mySql中的auto_increment字段吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆