How to remove a fulltext index in MySQL – switching from MyISAM to InnoDB

So, I decided to uninstall YARPP (the “yet another related posts plugin” for WordPress), and convert my wp_posts table from MyISAM back into InnoDB.

Of course, when I went to do the MyISAM -> InnoDB conversion, I got an error from myPhpAdmin:

The used table type doesn’t support FULLTEXT indexes

Not unexpected… versions of MySQL < 5.6.4 don’t support FULLTEXT in InnoDB, so I knew I had to drop the FULLTEXT indexes but didn’t quite know how. And it took a while to find the solution. But here it is:

 

1) Run the following query to get a list of your tables:

 SHOW CREATE TABLE wp_posts

 

(if you didn’t use the default wordpress table prefix or aren’t doing this for WordPress, replace wp_posts with… whatever table you’re having a problem with)

 

2) It will show you a list of the tables. You’re looking for something like this:

 

finding-fulltext

You can see the FULLTEXT part – the names of the index keys are yarpp_title and yarpp_content in this case.

 

3) Now to drop these fulltext keys, the following queries:

ALTER TABLE wp_posts DROP INDEX yarpp_title;
ALTER TABLE wp_posts DROP INDEX yarpp_content;

I did them one at a time. Obviously, if you’re not in 100%-the-same-boat-as-me, replace wp_posts with your table name, and yarpp_title / yarpp_content with whatever showed up in your results.

 

4) Exciting!

Assuming you got all the FULLTEXT keys taken care of, the following should work to convert the table to InnoDB now:

ALTER TABLE wp_posts ENGINE=InnoDB;

 

(assuming once again, it’s the wp_posts table you’re converting – if not, use the name of the table you’re converting)

…and, done!

4 Comments | Leave a Comment

  1. splizzer on November 5, 2016 - click here to reply
    Thank you very much, awesome tut!
    I had to change the storage type of my IP.Board database from MyISAM to InnoDB and this method worked for me.
  2. Anonym on January 11, 2017 - click here to reply
    Why not use MyISAM? When you use table `wp_posts` for posts, where are frequent selects (more reading than writing), then MyISAM is better solution than InnoDB.
  3. Anonymous on March 8, 2020 - click here to reply
    i did the above, but my table dissappeared.. i don't know where i went wrong
  4. Grzegorz on August 20, 2021 - click here to reply
    Works perfect. You are the best :-) , Thanks

Leave a Comment

You can use an alias and fake email. However, if you choose to use a real email, "gravatars" are supported. You can check the privacy policy for more details.