
MySQL
Crabime
所有源码参见我的GitHub:
https://github.com/Crabime
展开
-
ERROR 1215 (HY000): Cannot add foreign key constraint
mysql中在为一个char或者varchar类型数据列添加外键时,会发生上面所示的错误,这里我google了一下,感觉它们碰到的问题跟我这个说的有点不相干,尝试了多种方式后来才发现是:主表(table1)所对应关联的数据列必须为unique才可以。#指定主表dept列unique约束alter table table1 modify dept varchar(5) not null uniqu原创 2016-11-26 15:45:29 · 2693 阅读 · 0 评论 -
org.hibernate.PropertyValueException: not-null property references a null or transient value : xxx
今天本来时准备在mysql控制台中写一个一对一关联,外键放在连接表中,但是突然没有头绪到底该怎么写这样的表,于是借鉴hibernate高级“自动生成SQL语句”的方式看它是怎么写的,但是在做的过程中碰到了一个问题。原创 2016-11-27 15:17:36 · 9461 阅读 · 0 评论 -
ERROR 1025 (HY000): Error on rename of '.\test\#sql-c68_10' to '.\test\member' (errno: 150)
将member表id键改为bigint:alter table member modify column id BIGINT;执行时发现如下错误:ERROR 1025 (HY000): Error on rename of '.\test\#sql-c68_10' to '.\test\member' (errno: 150)原因:member表的id主键字段是另外一张addr原创 2017-08-13 11:00:28 · 8137 阅读 · 0 评论