ERROR 1025 (HY000): Error on rename of '.\test\#sql-c68_10' to '.\test\member' (errno: 150)
来源:互联网 发布:ssa字幕 mac播放器 编辑:程序博客网 时间:2024/05/18 13:45
将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主键字段是另外一张address的外键,修改主表id字段类型会导致主表与外键关联表字段不一致。
解决方法:
- 找到外键关联表,找到外键名字。
- 删除外键约束
- 修改主表(member)id字段类型:alter table member modify column id bigint;
- 修改辅表(address)member_id字段类型:alter table address modify column member_id bigint;
- 将删除的外键补上:alter table address add constraint fk_member_address foreign key (member_id) references member(id);
阅读全文
0 0
- ERROR 1025 (HY000): Error on rename of '.\test\#sql-c68_10' to '.\test\member' (errno: 150)
- ERROR 1025 (HY000): Error on rename of to
- ERROR 1025 (HY000): Error on rename of to
- MySQL ERROR 1025(HY000): Error on rename of ...
- mysql ERROR 1025 (HY000): Error on rename of
- MySQL ERROR 1025(HY000): Error on rename of ...
- MySQL 更改表外键报错:ERROR 1025: Error on rename of .... (errno: 150)
- mysql [Err] 1025 - Error on rename of '.' to '.\\#sql2-1638-7' (errno: 121)
- ERROR 1010 (HY000): Error dropping database (can’t rmdir ‘./test’, errno: 41)
- ERROR 1010 (HY000): Error dropping database (can't rmdir '.\test\', errno: 17)
- MySQL不能删除外键,抱错Error on rename of './ruler/test2child' to './ruler/#sql2-298-92' (errno: 152)
- MySQL不能删除外键,抱错Error on rename of './ruler/test2child' to './ruler/#sql2-298-92' (errno: 152)
- ERROR 1 (HY000): Can't create/write to file '/test.txt' (Errcode: 13)
- mysql:ERROR 1005 (HY000): Can't create table 'company.#sql-45d5_9' (errno: 150)
- MySQl更改外键报 Error on rename XXX to XXX(error:150) 解决办法
- libfreenect2 test error on GTX1070(notebook)
- ERROR 1005 (HY000): Can't create table 'XXXXX' (errno: 150)
- ERROR 1005 (HY000): Can't create table '' (errno: 150)
- 洛谷【P1725】琪露诺 DP的优化
- List源码阅读
- 2018网易校招内推编程题全解
- Listener(java传统监听器)
- Zabbix监控流程详解(自己的心得)
- ERROR 1025 (HY000): Error on rename of '.\test\#sql-c68_10' to '.\test\member' (errno: 150)
- 人工智能简介
- usb交互过程简介
- 《java 多线程编程核心技术》读书笔记三(补充内容)
- CodeForces round 428 div2 only
- C++多线程学习(一)
- Mac VMware 序列号
- Linux的内存理解
- 环形对列(circle queue 1329 P103)