<small id='NEyDI'></small><noframes id='NEyDI'>

      1. <i id='NEyDI'><tr id='NEyDI'><dt id='NEyDI'><q id='NEyDI'><span id='NEyDI'><b id='NEyDI'><form id='NEyDI'><ins id='NEyDI'></ins><ul id='NEyDI'></ul><sub id='NEyDI'></sub></form><legend id='NEyDI'></legend><bdo id='NEyDI'><pre id='NEyDI'><center id='NEyDI'></center></pre></bdo></b><th id='NEyDI'></th></span></q></dt></tr></i><div id='NEyDI'><tfoot id='NEyDI'></tfoot><dl id='NEyDI'><fieldset id='NEyDI'></fieldset></dl></div>
        • <bdo id='NEyDI'></bdo><ul id='NEyDI'></ul>
        <legend id='NEyDI'><style id='NEyDI'><dir id='NEyDI'><q id='NEyDI'></q></dir></style></legend>

        <tfoot id='NEyDI'></tfoot>

        更改步骤 auto_increment 字段增量

        Change the step auto_increment fields increment by(更改步骤 auto_increment 字段增量)
      2. <i id='DZKW1'><tr id='DZKW1'><dt id='DZKW1'><q id='DZKW1'><span id='DZKW1'><b id='DZKW1'><form id='DZKW1'><ins id='DZKW1'></ins><ul id='DZKW1'></ul><sub id='DZKW1'></sub></form><legend id='DZKW1'></legend><bdo id='DZKW1'><pre id='DZKW1'><center id='DZKW1'></center></pre></bdo></b><th id='DZKW1'></th></span></q></dt></tr></i><div id='DZKW1'><tfoot id='DZKW1'></tfoot><dl id='DZKW1'><fieldset id='DZKW1'></fieldset></dl></div>

        • <bdo id='DZKW1'></bdo><ul id='DZKW1'></ul>

            <tfoot id='DZKW1'></tfoot>

            1. <legend id='DZKW1'><style id='DZKW1'><dir id='DZKW1'><q id='DZKW1'></q></dir></style></legend>
            2. <small id='DZKW1'></small><noframes id='DZKW1'>

                <tbody id='DZKW1'></tbody>
                • 本文介绍了更改步骤 auto_increment 字段增量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何将 MySQL 增量中的 auto_increment 字段的数量从默认值 (1) 更改为 n?

                  How do I change the amount auto_increment fields in MySQL increment by from the default (1) to n?

                  推荐答案

                  如果您想将自动增量步长从 1 更改为 N 那么有一个解决方案.它可以在 MySQL 服务器端完成:寻找--auto-increment-increment"启动选项或使用以下命令SET @@auto_increment_increment=2;,但请注意这是服务器范围的更改(所有表都将增加 2).

                  If you want to change autoincrement step from 1 to N then there is a solution. It could be done on MySQL server side: look for '--auto-increment-increment' startup option or use following command SET @@auto_increment_increment=2;, but be warned that this is a server wide change (all tables will increment by 2).

                  可以考虑的非传统解决方案:

                  Unortodox solutions could that could be considered:

                  1. 在同一台机器上启动两个 MySQL 服务器,使用不同的端口(一个使用 auto_increment_increment=1 另一个使用 auto_increment_increment=2)
                  2. 使用一些服务器端魔法(PHP、ASP、???)结合关闭表auto_increment 来手动计算(简单地查看最后一个 id 和 +=2 就可以了)并在INSERT 查询.
                  1. Launch two MySQL servers on same machine, with different ports (one with auto_increment_increment=1 other with auto_increment_increment=2)
                  2. Use some serverside magic (PHP, ASP ,???) combined with turning off tables auto_increment to manually calculate (simple peek at last id and +=2 would be ok) and provide id in INSERT query.

                  一些官方 MySQL 常见问题

                  这篇关于更改步骤 auto_increment 字段增量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Select n random rows from SQL Server table(从 SQL Server 表中随机选择 n 行)
                  Oracle: how to UPSERT (update or insert into a table?)(Oracle:如何 UPSERT(更新或插入表?))
                  What is the difference between Scope_Identity(), Identity(), @@Identity, and Ident_Current()?(Scope_Identity()、Identity()、@@Identity 和 Ident_Current() 之间有什么区别?)
                  Inner join vs Where(内连接 vs Where)
                  Oracle SQL: Update a table with data from another table(Oracle SQL:用另一个表中的数据更新一个表)
                  Oracle SQL pivot query(Oracle SQL 数据透视查询)
                    <tbody id='nLej9'></tbody>
                  <legend id='nLej9'><style id='nLej9'><dir id='nLej9'><q id='nLej9'></q></dir></style></legend>
                      • <i id='nLej9'><tr id='nLej9'><dt id='nLej9'><q id='nLej9'><span id='nLej9'><b id='nLej9'><form id='nLej9'><ins id='nLej9'></ins><ul id='nLej9'></ul><sub id='nLej9'></sub></form><legend id='nLej9'></legend><bdo id='nLej9'><pre id='nLej9'><center id='nLej9'></center></pre></bdo></b><th id='nLej9'></th></span></q></dt></tr></i><div id='nLej9'><tfoot id='nLej9'></tfoot><dl id='nLej9'><fieldset id='nLej9'></fieldset></dl></div>

                        <tfoot id='nLej9'></tfoot>
                            <bdo id='nLej9'></bdo><ul id='nLej9'></ul>
                          • <small id='nLej9'></small><noframes id='nLej9'>