MySQL ERROR 1005: Can't create table (errno: 150)
来源:互联网 发布:红木进口数据 编辑:程序博客网 时间:2024/04/28 22:49
执行以下语句时
alter table t_price add constraint FK_PRICE_REF_APP foreign key (app_id) references t_app (ID) on delete cascade on update restrict
报告:
ERROR 1005 (HY000): Can't create table 'iread.#sql-f0b_6629b' (errno: 150)
解决办法:
1) 检查表的存储引擎是否是 InnoDB,如果不是的话,将其改为InnoDB. 在MyIsam模式下,无法创建外键。
修改my.cnf,在[mysqld]下加上
default-storage-engine=InnoDB
修改已经建成表的引擎:
alter table tablename type=InnoDB
2) 先禁用外键检查,然后创建外键,最后再打开
set foreign_key_checks = 0;
alter table....foreign key...;
set foreign_key_checks = 1;
一切OK
- MySQL ERROR 1005: Can't create table (errno: 150)解决办法
- MySQL ERROR 1005: Can't create table (errno: 150)解
- MySQL ERROR 1005: Can't create table (errno: 150)
- MySQL ERROR 1005: Can't create table (errno: 150)解决办法
- MySQL ERROR 1005: Can't create table (errno: 150)
- MySQL ERROR 1005: Can't create table (errno: 150)
- MySQL ERROR 1005: Can’t create table (errno: 150)解决办法
- MySQL ERROR 1005: Can't create table (errno: 150)解决办法
- MySQL ERROR 1005: Can't create table (errno: 150)解决办法
- MySQL ERROR 1005: Can't create table (errno: 150)解决办法
- MySQL ERROR 1005: Can't create table (errno: 150)解决办法
- MySQL ERROR 1005: Can't create table (errno: 150)解决办法
- mysql ERROR: Error 1005: Can't create table (errno: 121)
- mysql 1005-Can't create table ''error:121&mysql error 1005 can't create table'<errno:150>
- MYSQL ERRNO:#1005 - Can't create table '***' (errno: 150)
- mysql can't create table errno 150
- ERROR 1005: Can’t create table (errno: 150)
- ERROR 1005 (HY000): Can't create table 'XXXXX' (errno: 150)
- 喇叭原理及使用时需要避免的事项
- 深入浅出之正则表达式(二)
- python中文编码详解
- 利用 VisualSVN 自动同步更新到网站服务器 的方法
- Oracle 字符集的查看和修改
- MySQL ERROR 1005: Can't create table (errno: 150)
- DLL.LIB.EXE.TLB
- 程序规模对构建的影响
- Java导出Excel文件实例
- 工作总结
- ImageMagick
- C++ 类的静态成员(static)
- android滑动解锁
- Linux之gunzip命令