如何在 MySQL 中设置 AUTO_INCREMENT 字段以值 6000 开头?
MySQL中如何将非自增字段设置为自增?如何将自动增量起始值设置为6000?
How can I set a non-auto-increment field to auto increment in MySQL? And how can I set the auto increment start value to 6000?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您的表已经存在:
如果您从头开始创建表:
来源和进一步阅读:
测试用例:
If your table already exists:
If you are creating your table from scratch:
Source and further reading:
Test case:
但请注意,此表中不应有 PK lager 6000!
but be aware you should have no PK lager 6000 in this table !
如果您对包含自动增量 PK 和 PK 的表执行以下命令,mysql 将向您显示正确的语法以及更多内容。已经有一些数据:
mysql will show you the correct syntax for this, and more, if you execute the following for a table that contains an auto increment PK & some data already: