欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

​ RROR 1221 (HY000): Incorrect usage of spatial/fulltext/hash index and explicit index orde ​

发布时间:2024/4/18 编程问答 47 豆豆
生活随笔 收集整理的这篇文章主要介绍了 ​ RROR 1221 (HY000): Incorrect usage of spatial/fulltext/hash index and explicit index orde ​ 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

错误判断:

RROR 1221 (HY000): Incorrect usage of spatial/fulltext/hash index and explicit index orde

类似这样的错误是因为给索引提供了错误的附加条件,

 son表如下:

mysql> desc son; +-----------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+-------------+------+-----+---------+-------+ | id | int | YES | MUL | NULL | | | name | char(20) | YES | | NULL | | | grade | tinyint | YES | | NULL | | | favourate | varchar(39) | YES | | NULL | | +-----------+-------------+------+-----+---------+-------+ 4 rows in set (0.00 sec)

给son表增加一个fulltext索引,code如下:

 

mysql> create fulltext index son_index on son(name(10) asc); ERROR 1221 (HY000): Incorrect usage of spatial/fulltext/hash index and explicit index order

结果引发错误,varchar类型不能指定asc

总结

以上是生活随笔为你收集整理的​ RROR 1221 (HY000): Incorrect usage of spatial/fulltext/hash index and explicit index orde ​的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。