views:

590

answers:

3

So I’m trying to create a FULLTEXT index on an attribute of a table. Mysql returns ERROR 1214: The used table type doesn’t support FULLTEXT indexes.

Any idea what I’m doing wrong?

+1  A: 

The mysql manual says that FULLTEXT indexes can only be created on tables with the mylsam engine.

soulmerge
+1  A: 

Are you using InnoDB? The only table type that supports FULLTEXT is MyISAM.

Artem Russakovskii
+6  A: 

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 is the only type of table that Mysql supports for Full-text indexes.

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

SHOW TABLE STATUS

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 then Mysql will throw an error if your trying to add FULLTEXT indexes.

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

ALTER TABLE <table name> ENGINE = MYISAM

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 ont he server, and doesn't support the FULLTEXT indexes.

Gnatz
Misprint: MYISAM*
Artem Russakovskii
No, but the ALTER TABLE statement says "MYISM".
Henning
Ahh thanks guys... corrected it.
Gnatz
Sorry to bug you again, but the bit you added at the end at least needs clarification. MyISAM does not support transactions. And why would MyISAM be better for updates? It locks every row it touches on updates, and while it performs well in heavy read/low write scenarios, it fails in heavy write scenarios.
Henning
I was going from memory on that part... I'll look it up again and if I was wrong change it shortly... Thanks for heads up again. Perhaps I got the two swapped in pros and cons.
Gnatz