zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

MySQL MyISAM 添加外键失败

mysql 添加 失败 外键 MyISAM
2023-09-14 08:59:41 时间

MySQL 在做某个表的外键关联时,提示如下错误

1215 - Cannot add foreign key constraint

后查,该表的存储引擎为 MyISAM

在 MySQL 的官方文档中提到,MyISAM 是 不支持外键的,“Foreign key support No”。


Backup / point-in-time recovery[d] Query cache support Update statistics for data dictionary

[a] Compressed MyISAM tables are supported only when using the compressed row format. Tables using the compressed row format with MyISAM are read only.


[b] Implemented in the server (via encryption functions), rather than in the storage engine.


[c] Implemented in the server, rather than in the storage engine.


[d] Implemented in the server, rather than in the storage engine.


连接远程mysql数据库失败常见原因及解决办法 1. 没有开启 MySQL 的远程登陆帐号。 1.找到mysql数据库的user表。在user表中新建一条数据,设置User(username)和Host(开放访问MySQL的IP:例如123.118.17.201)以及登录密码。这样就设置了允许访问的用户名和IP地址(若想所有IP都可以访问,则可将Host设置为‘%’,但是这样很危险,不建议)。