Yii FULLTEXT not supported, but it definitely is supported

1k Views Asked by At

Edit: figured out the issue. My answer to this provides the details.

Using Yii 1.1.13, MySQL 5.6.13, PHP 5.4.9

In an application I'm developing in Yii, I'm using a FULLTEXT query with CDbCriteria:

$criteria = new CDbCriteria;

$criteria->condition = "MATCH (item_name, description) AGAINST(:keyword IN BOOLEAN MODE)";
$criteria->params = array(
    ':keyword' => "$this->q*",
);

If I try to run this, I get

General error: 1214 The used table type doesn't support FULLTEXT indexes. 

However, I installed this mysql version specifically to be able to use FKs and FULLTEXT indices.

If I copy the same exact SQL into a mysql client (be it phpMyAdmin, /usr/local/bin/mysql [5.6.13], or /usr/bin/mysql [5.5.32]), it works fine. Is Yii shoehorning it's own version of mysql in there? Pretty sure Yii uses PDO, and I know PDO works on this setup when not used with Yii. I've tried searching this issue and I just come up with results of people making a pre-5.6 mistake.

2

There are 2 best solutions below

1
Neophile On

the default storage engine in mysql is InnoDB which does not support FULLTEXT indexes just change the Storage engine to MyISAM that will solve your problem

1
Neil On

Alright guys and gals, I'm a little embarrassed. I have two development servers (most of you can see where this is going). Server A is mysql 5.1, Server B is mysql 5.6. The NetBeans project and my DNS entries were still pointing at the old server, yet my phpMyAdmin A record was already pointing at my new one. After fixing, everything works. Thanks for reading, at least!