zoukankan      html  css  js  c++  java
  • MYSQL: Cannot delete or update a parent row: a foreign key constraint fails

    更新数据库信息的时候 提示如家错误,MSSQL中都没有这些问题
    Error No. 1451      
    Cannot delete or update a parent row: a foreign key constraint fails (...)      
    这可能是MySQL在InnoDB中设置了foreign key关联,造成无法更新或删除数据。可以通过设置FOREIGN_KEY_CHECKS变量来避免这种情况。      
    SET FOREIGN_KEY_CHECKS = 0;      
    删除完成后设置      
    SET FOREIGN_KEY_CHECKS = 1;      
    其他:      
    关闭唯一性校验      
    set unique_checks=0;      
    set unique_checks=1;

  • 相关阅读:
    Vue
    Vue
    Vue
    Vue
    Vue
    kubernetes
    kubernetes
    kubernetes
    django源码bug解决方案
    UNI-APP 桌面LOGO角标设置(ios)
  • 原文地址:https://www.cnblogs.com/liusir/p/3424239.html
Copyright © 2011-2022 走看看