MySQL错误1265:列的数据被截断

问题描述

我不知道为什么收到此消息。我正在使用MySQL Workbench,正在编辑ENUM字段中的值,该字段连接到应用程序中的下拉选项。

一切似乎都很好。我已经搜索了此错误,发现的所有错误都与数据类型不匹配有关,但是在这种情况下,使用ENUM将字符串值数组提供给它是不可能的。

这是SQL

Executing:
ALTER TABLE `mydbase`.`average_monthly_expenses` 
CHANGE COLUMN `expense_category` `expense_category` ENUM('Home','Healthcare','Child care','Groceries and supplies','Eating out','Utilities','Telecomms','Laundry and cleaning','Clothes','Education','Entertainment gifts vacation','Auto and transportation','Insurance','Savings and investments','Charitable contributions','Itemized monthly payments') NULL DEFAULT NULL ;

Operation failed: There was an error while applying the SQL script to the database.
ERROR 1265: Data truncated for column 'expense_category' at row 1
SQL Statement:
ALTER TABLE `mydbase`.`average_monthly_expenses` 
CHANGE COLUMN `expense_category` `expense_category` ENUM('Home','Itemized monthly payments') NULL DEFAULT NULL

任何建议都非常欢迎

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)