运行alter操作,

alter table xx_shop_info add index FK9050F5D83304CDDC (shop_area), add constraint FK9050F5D83304CDDC foreign key (shop_area) references xx_shop_area (id)

出现下面的错误

Error : Can't create table 'moshop_1.#sql-534_185' (errno: 150)

找了好多原因,总结能够列举例如以下,我的犯错的是5

1、外键的引用类型不一样,主键是int外键是char

2、找不到主表中 引用的列

3、主键和外键的字符编码不一致 

4、还有要建立外键的话,要先建立索引。没有建立索引也会出错。

5、还有可能是是标的Table Type 不正确,例如以下的InnoDB 和MyISAM的错误

【Bug Fix】Error : Can't create table 'moshop_1.#sql-534_185' (errno: 150)的更多相关文章

  1. 【MySQL】ERROR 1005: Can't create table (errno: 150)的错误解决办法

    在mysql 中建立引用约束的时候会出现MySQL ERROR 1005: Can't create table (errno: 150)的错误信息结果是不能建立 引用约束. 出现问题的大致情况 1. ...

  2. MySQL ERROR 1005: Can't create table (errno: 150)的错误解决办法

    在mysql 中建立引用约束的时候会出现MySQL ERROR 1005: Can't create table (errno: 150)的错误信息结果是不能建立 引用约束. 出现问题的大致情况 1. ...

  3. 使用Navicat V8.0创建数据库,外键出现错误ERROR 1005: Can’t create table (errno: 121)

    ERROR 1005: Can't create table (errno: 121) errno 121 means a duplicate key error. Probably the tabl ...

  4. 【MySQL案件】ERROR 1665 (HY000)

    转载请注明: http://blog.csdn.net/jason_asia/article/details/36240815 1.1.1. ERROR 1665 (HY000) [环境的叙述性说明] ...

  5. 【MySQL案件】ERROR 1418

    1.1.1. ERROR 1418 [环境的叙述性说明] mysql5.0.67 [问题叙述性说明] 当它来到创建存储过程ERROR 1418一个错误. # 创建函数SQL声明 CREATE FUNC ...

  6. 【MySQL案例】error.log的Warning:If a crash happens thisconfiguration does not guarantee that the relay lo(转)

    标签: 1.1.1. If a crash happens thisconfiguration does not guarantee that the relay log info will be c ...

  7. 【MySQL案例】ERROR 1786 (HY000)

    1.1.1. ERROR 1786 (HY000) [环境描写叙述] msyql5.6.14 [报错信息] 运行create table ... select的时候遇到报错: db1 [test] [ ...

  8. 【MySQL案例】error.log的Warning:If a crash happens thisconfiguration does not guarantee that the relay lo

    1.1.1. If a crash happens thisconfiguration does not guarantee that the relay log info will be consi ...

  9. 【bug解决】ios微信浏览器中背景音乐无法播放

    我记得之前在一次项目中,出现过浏览报错: 当时的文档链接如右:[解决]HTML5新标签audio的autoplay自动播放属性失效的解决方案 所以在这次H5的制作中,我使用了iframe来加载音频文件 ...

随机推荐

  1. How to search a table in a store proc and open the store proc

    1. select*fromdba_dependencieswherereferenced_name='CNTL_ISSUE'andTYPE='PROCEDURE' 2. selecttextfrom ...

  2. 2数组的slice和splice方法

    var colors=["blue","red","black","yellow","gray",& ...

  3. boost::asio 连接管理11 如何关闭连接

    在实际产品运行中,对连接管理有了更新的认识,这里分享一下. shared_ptr管理连接对象的生命周期 shared_ptr的引用计数器决定了连接对象的生命周期.这里我说的连接对象就是在我的前文:ht ...

  4. HTTP协议结构

    HTTP报文=从客户机到服务器的请求+从服务器到客户机的响应 1.请求报文的格式如下: 请求头   通用信息头    请求头    实体头    报文主体 请求行的格式为: Method[分隔符]Re ...

  5. hive udaf 用maven打包运行create temporary function 时报错

    用maven打包写好的jar,在放到hive中作暂时函数时报错. 错误信息例如以下: hive> create temporary function maxvalue as "com. ...

  6. zabbix 监控jvm

    tomcat 机器配置: [root@wx03 lib]# pwd /usr/local/apache-tomcat-7.0.55/lib [root@wx03 lib]# ls -ltr *jmx* ...

  7. 使用mex进行混合编程的一些注意事项

    1.mxGetPr的使用: Use mxGetPr on arrays of type double only. Use mxIsDouble to validate the mxArray type ...

  8. 显示器 Linux 性能 18 (一个命令行工具传递)

    对于系统和网络管理员来说每天监控和调试Linux系统的性能问题是一项繁重的工作.在IT领域作为一名Linux系统的管理员工作5年后,我逐渐认识到监控和保持系统启动并执行是多么的不easy.基于此原因. ...

  9. Swift - 本地数据的保存与加载(使用NSCoder将对象保存到.plist文件)

    下面通过一个例子将联系人数据保存到沙盒的“documents”目录中.(联系人是一个数组集合,内部为自定义对象). 功能如下: 1,点击“保存”将联系人存入userList.plist文件中 2,点击 ...

  10. Swift Swift语言Storyboard教程:第二部

    本文由CocoaChina翻译小组@TurtleFromMars翻译自raywenderlich,原文:Storyboards Tutorial in Swift: Part 2 更新记录:该Stor ...