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

        <tfoot id='tvvfO'></tfoot>

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

      1. 表存在后添加新ID(自动增量)的麻烦

        时间:2023-07-17
              • <bdo id='G9xwB'></bdo><ul id='G9xwB'></ul>
                <i id='G9xwB'><tr id='G9xwB'><dt id='G9xwB'><q id='G9xwB'><span id='G9xwB'><b id='G9xwB'><form id='G9xwB'><ins id='G9xwB'></ins><ul id='G9xwB'></ul><sub id='G9xwB'></sub></form><legend id='G9xwB'></legend><bdo id='G9xwB'><pre id='G9xwB'><center id='G9xwB'></center></pre></bdo></b><th id='G9xwB'></th></span></q></dt></tr></i><div id='G9xwB'><tfoot id='G9xwB'></tfoot><dl id='G9xwB'><fieldset id='G9xwB'></fieldset></dl></div>

              • <small id='G9xwB'></small><noframes id='G9xwB'>

              • <tfoot id='G9xwB'></tfoot>
                  <legend id='G9xwB'><style id='G9xwB'><dir id='G9xwB'><q id='G9xwB'></q></dir></style></legend>

                    <tbody id='G9xwB'></tbody>
                  本文介绍了表存在后添加新ID(自动增量)的麻烦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个包含 38.000 条记录的表,但没有任何像 ID 这样的自动增量列.
                  现在我必须添加一个ID列,我想知道会不会有麻烦?

                  I have a table with 38.000 records, but without any auto increment column like ID.
                  Now I have to add an ID column, and I'm wondering could there be troubles?

                  推荐答案

                  您对任何字段的定义更改的问题是更改是破坏性的".最好将这样的更改视为数据迁移.我没有用 MySQL 这样做过,但不得不为 SQL Server 添加自动编号.基本思路是一样的.

                  You problem with definition change to any field is the change is "destructive". It is best to treat changes like this as a data migration. I have not done this with MySQL, but have had to add auto numbering to SQL Server. The basic idea is the same.

                  查看文档,因为 MySQL 可能有一种无需重置字段即可添加自动增量的机制.如果是这样,通过 SQL 执行此操作将解决问题.总的来说,我建议不要使用工具直观地进行这些类型的更改,因为大多数工具的方法学具有很强的破坏性.

                  Check the documentation, as MySQL may have a mechanism for adding aut increment without resetting the field. If so, doing it via SQL will solve the problem. In general, I recommend against doing these types of changes visually, with a tool, as most tools are very destructive in their methdology.

                  这篇关于表存在后添加新ID(自动增量)的麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:mysqldump - 仅导出结构而没有自动增量 下一篇:应用自动增量时,MySQL 会重用已删除的 ID

                  相关文章

                    <bdo id='Oh57J'></bdo><ul id='Oh57J'></ul>
                    <legend id='Oh57J'><style id='Oh57J'><dir id='Oh57J'><q id='Oh57J'></q></dir></style></legend>

                    1. <small id='Oh57J'></small><noframes id='Oh57J'>

                      <tfoot id='Oh57J'></tfoot>
                      <i id='Oh57J'><tr id='Oh57J'><dt id='Oh57J'><q id='Oh57J'><span id='Oh57J'><b id='Oh57J'><form id='Oh57J'><ins id='Oh57J'></ins><ul id='Oh57J'></ul><sub id='Oh57J'></sub></form><legend id='Oh57J'></legend><bdo id='Oh57J'><pre id='Oh57J'><center id='Oh57J'></center></pre></bdo></b><th id='Oh57J'></th></span></q></dt></tr></i><div id='Oh57J'><tfoot id='Oh57J'></tfoot><dl id='Oh57J'><fieldset id='Oh57J'></fieldset></dl></div>