重命名MySQL中的列时出错 [英] Error renaming a column in MySQL
本文介绍了重命名MySQL中的列时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何重命名表 xyz
中的列?列为:
How do I rename a column in table xyz
? The columns are:
Manufacurerid, name, status, AI, PK, int
我想重命名为制造商
我尝试使用PHPMyAdmin面板,但我得到这个错误:
I tried using PHPMyAdmin panel, but I get this error:
MySQL said: Documentation
#1025 - Error on rename of '.\shopping\#sql-c98_26' to '.\shopping\tblmanufacturer' (errno: 150)
推荐答案
Lone Ranger非常接近...实际上,您还需要指定重命名列的数据类型。例如:
Lone Ranger is very close... in fact, you also need to specify the datatype of the renamed column. For example:
ALTER TABLE `xyz` CHANGE `manufacurerid` `manufacturerid` INT;
请记住:
- 将INT替换为您的列数据类型(必填)
- Tilde / Backtick(`)是可选的
这篇关于重命名MySQL中的列时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文