网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  mysql add foreign key 不成功

mysql add foreign key 不成功

分类: IT文章 • 2022-03-22 23:51:07

mysql add foreign key 不成功

今天修改了mysql数据表的结构,然后添加外键index一直不成功:

mysql add foreign key 不成功

查到问题在于,被外键的表,引擎不是Innodb,而是MyISAM。

mysql add foreign key 不成功

修改好,以后保存报错:

mysql add foreign key 不成功

解决办法,将数据库表里的数据全部删除,再保存外键信息,最终成功。

相关推荐

  • MySQL数据库 外键 foreign key
  • MySQL命令2 Insert into a MySQL table or update if exists truncate foreign key constrained table How to reset AUTO_INCREMENT in MySQL?
  • 解决ORM错误:django.db.utils.IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constraint fails
  • cannot add or update a child row: a foreign key constraint fails
  • MySQL主从复制中断,报“Error on master: message (format)='Cannot delete or update a parent row: a foreign key constraint fails' error code=1217” 异常
  • MySQL删除foreign key_ERROR 1025 (HY000): Error on rename of './test_20180206/cc' to './test_20180206/#sql2-9ac-e' (errno: 152)
  • MySQL 约束条件 基础知识 DEFAULT NOT NULL UNIQUE PRIMARY KEY AUTO_INCREMENT FOREIGN KEY
  • 【MySQL】怎么在phpMyAdmin中增加innoDB,并新建外键Foreign Key
  • SET FOREIGN_KEY_CHECKS=0;在Mysql中取消外键约束
  • Mysql-外键foreign key
  • list转datatable,SqlBulkCopy将DataTable中的数据批量插入数据库
  • highcharts学习1----Line charts
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号