MySQL FULLTEXT索引问题

问题描述:

我正在尝试在表格的属性上创建FULLTEXT索引. Mysql返回

I’m trying to create a FULLTEXT index on an attribute of a table. Mysql returns

错误1214:使用的表类型不支持FULLTEXT索引.

ERROR 1214: The used table type doesn’t support FULLTEXT indexes.

知道我在做什么错吗?

Any idea what I’m doing wrong?

您使用的表格类型错误. Mysql支持几种不同类型的表,但是最常用的是MyISAM和InnoDB. MyISAM(在MySQL 5.6+中也是InnoDB表)是表的类型Mysql支持全文索引.

You’re using the wrong type of table. Mysql supports a few different types of tables, but the most commonly used are MyISAM and InnoDB. MyISAM (in MySQL 5.6+also InnoDB tables) are the types of tables that Mysql supports for Full-text indexes.

要检查表的类型,请发出以下sql查询:

To check your table’s type issue the following sql query:

SHOW TABLE STATUS

查看查询返回的结果,在引擎"列中找到表和相应的值.如果此值是MyISAM或InnoDB以外的任何值,那么如果您尝试添加FULLTEXT索引,则Mysql将引发错误.

Looking at the result returned by the query, find your table and corresponding value in the Engine column. If this value is anything except MyISAM or InnoDB then Mysql will throw an error if your trying to add FULLTEXT indexes.

要解决此问题,您可以使用下面的sql查询来更改引擎类型:

To correct this, you can use the sql query below to change the engine type:

ALTER TABLE <table name> ENGINE = [MYISAM | INNODB]

其他信息(认为可能有用): Mysql使用不同的引擎存储类型来优化特定表所需的功能.示例MyISAM是操作系统(除了Windows)的默认类型,可以快速执行SELECT和INSERT.但不处理交易. InnoDB是Windows的默认设置,可用于事务处理.但是InnoDB确实需要服务器上更多的磁盘空间.

Additional information (thought it might be useful): Mysql using different engine storage types to optimize for the needed functionality of specific tables. Example MyISAM is the default type for operating systems (besides windows), preforms SELECTs and INSERTs quickly; but does not handle transactions. InnoDB is the default for windows, can be used for transactions. But InnoDB does require more disk space on the server.