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

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

问题描述

在 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 参考了解更多详情.

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

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