更改自动递增起始编号? [英] Change auto increment starting number?

查看:78
本文介绍了更改自动递增起始编号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MySQL中,我有一个表,我想将auto_increment值设置为5而不是1.这可能吗,这是什么查询语句?

In MySQL, I have a table, and I want to set the auto_increment value to 5 instead of 1. Is this possible and what query statement does this?

推荐答案

您可以使用ALTER TABLE更改auto_increment初始值:

You can use ALTER TABLE to change the auto_increment initial value:

ALTER TABLE tbl AUTO_INCREMENT = 5;

有关更多信息,请参见 MySQL参考详细信息.

See the MySQL reference for more details.

这篇关于更改自动递增起始编号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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