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

    <bdo id='uGvUE'></bdo><ul id='uGvUE'></ul>

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

        mysql 外键约束格式错误

        时间:2023-08-17
        <tfoot id='V6cAf'></tfoot>

          <tbody id='V6cAf'></tbody>

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

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

              <legend id='V6cAf'><style id='V6cAf'><dir id='V6cAf'><q id='V6cAf'></q></dir></style></legend>

                  本文介绍了mysql 外键约束格式错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有两个表,table1 是带有 ID 列的父表和带有 IDFromTable1 列的 table2>(不是实际名称)当我在 IDFromTable1ID 上添加 FK 到 table1 时,我收到错误 Foreign key constraint is错误形成的错误.如果 table1 记录被删除,我想删除表 2 记录.感谢您的帮助

                  I have two tables, table1 is the parent table with a column ID and table2 with a column IDFromTable1 (not the actual name) when I put a FK on IDFromTable1 to ID in table1 I get the error Foreign key constraint is incorrectly formed error. I would like to delete table 2 record if table1 record gets deleted. Thanks for any help

                  ALTER TABLE `table2`  
                     ADD CONSTRAINT `FK1` 
                        FOREIGN KEY (`IDFromTable1`) REFERENCES `table1` (`ID`) 
                        ON UPDATE CASCADE 
                        ON DELETE CASCADE;
                  

                  如果需要任何其他信息,请告诉我.我是 mysql 的新手

                  Let me know if any other information is needed. I am new to mysql

                  推荐答案

                  对于遇到此问题的任何人,只需运行显示引擎 INNODB 状态并查看最新外键错误部分了解详情.

                  For anyone facing this problem, just run SHOW ENGINE INNODB STATUS and see the LATEST FOREIGN KEY ERROR section for details.

                  这篇关于mysql 外键约束格式错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:MySQL 在 ORDER BY 中获取行位置 下一篇:MySQL 的“IF EXISTS"的使用

                  相关文章

                  最新文章

                      <tfoot id='7sDwL'></tfoot>

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

                        <bdo id='7sDwL'></bdo><ul id='7sDwL'></ul>
                    1. <small id='7sDwL'></small><noframes id='7sDwL'>