首页 > 解决方案 > 如何在 phpmyadmin 中导入这个 github repo 的 sql 文件

问题描述

我想将此 repo 数据库导入我的数据库:

https://github.com/dr5hn/countries-states-cities-database

我正在尝试在 phpmyadmin 中导入 cites.sql、state.sql 和 country.sql,但它显示此错误:

Can't create table `<tablename>`.`#sql-450c_17f` (errno: 150 "Foreign key constraint is incorrectly formed")**

标签: sqlgithubphpmyadmin

解决方案


检查引用列是否与外键列的数据类型或长度相同

例如(参考:int(10),国外:int(10))


推荐阅读