bitscn.com
mysql修改或者创建索引是的错误提示:error 1170 (42000): blob/t...解决
在创建或修改mysql索引时出现了这样的错误:
error 1170 (42000): blob/text column 'col2' used in key specification without a key length
看了下该表的数据结构发现col2字段类型是text ,查询了下发现是:
mysql只能将blob/text类型字段设置索引为blob/text数据的钱n个字符.
索引指定下col2的长度就可以了 :
alter table foo add index col_2 (col2(10))
bitscn.com
