原文:Mysql錯誤1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解決方法

報錯的原因大概分為三種: 原因一: 添加的外鍵列與另一個表的唯一索引列 一般是主鍵 的數據類型不同原因二:要添加外鍵的表類型與另一個表的存儲引擎是不是都為innodb引擎 查看表引擎法一: show create table 表名 法二:show table status from 數據庫 where name 表名 法三:use information schema select table c ...

2021-02-25 10:01 0 329 推薦指數:

查看詳情

 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM