使用的表类型不支持FULLTEXT索引 [英] The used table type doesn't support FULLTEXT indexes
问题描述
我将此表数据导入phpmyadmin:
I import this table data into phpmyadmin:
CREATE TABLE IF NOT EXISTS `cms_books` (
`id` bigint(20) NOT NULL,
`title` varchar(255) COLLATE utf8_persian_ci NOT NULL,
`seo_title` varchar(255) COLLATE utf8_persian_ci NOT NULL,
`orginal_title` varchar(255) COLLATE utf8_persian_ci NOT NULL,
`pub_type` tinyint(2) NOT NULL,
`long_desc` longtext COLLATE utf8_persian_ci NOT NULL,
`counter` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8;
我看到这个错误:
-
-表cms_books
-
更改表cms_books
添加主键(id
),添加全文键title
(title
),添加全文键long_desc
(long_desc
);
MySQL说:文档
ALTER TABLE cms_books
ADD PRIMARY KEY (id
), ADD FULLTEXT KEY title
(title
), ADD FULLTEXT KEY long_desc
(long_desc
);
MySQL said: Documentation
#1214-使用的表类型不支持FULLTEXT索引
#1214 - The used table type doesn't support FULLTEXT indexes
在本地主机中,我为标题和long_desc
添加fulltext
,所以这可行,但是当我导入时,我看到此错误.如何解决此错误?
In localhost i add fulltext
for title and long_desc
so this worked but when i import i see this error. how do fix this error?
推荐答案
您需要将引擎更改为MyISAM.在INNODB中的MySQL 5.6之后,支持全文搜索.您可以通过此处进行检查.
You need to change your engine to MyISAM. FULL TEXT Search is supported after MySQL 5.6 in INNODB. You can check it over here.
请参见 MYSQL文档:
仅MyISAM表支持全文搜索. (在MySQL 5.6中 以及更高版本,它们也可以与InnoDB表一起使用.)
Full-text searches are supported for MyISAM tables only. (In MySQL 5.6 and up, they can also be used with InnoDB tables.)
这篇关于使用的表类型不支持FULLTEXT索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!