【问题标题】:manually set an order number with auto increment in MYSQL [duplicate]在MYSQL中手动设置具有自动增量的订单号[重复]
【发布时间】:2017-11-06 11:19:22
【问题描述】:

我正在寻找一个 MySQL 代码来设置具有自动增量的订单号。

这已经在数据库中了,但我想更改订单号 我希望有人可以提供帮助。

非常感谢 问候弗莱明

【问题讨论】:

  • “更改订单号”是什么意思?

标签: mysql


【解决方案1】:

您可以按照https://dev.mysql.com/doc/refman/5.7/en/replication-options-master.html#sysvar_auto_increment_increment 中的文档所述更改自动增量和偏移量:

SET @@auto_increment_increment=x;
SET @@auto_increment_offset=y;

其中 x & y 是您需要设置的值

【讨论】:

    猜你喜欢
    • 2016-03-13
    • 2021-06-03
    • 1970-01-01
    • 1970-01-01
    • 2015-12-22
    • 2018-11-30
    • 1970-01-01
    • 2016-02-05
    相关资源
    最近更新 更多