Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The used table type doesn't support FULLTEXT indexes

Tags:

mysql

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;

and i see this error :

--

-- Indexes for table cms_books

--

ALTER TABLE cms_books ADD PRIMARY KEY (id), ADD FULLTEXT KEY title (title), ADD FULLTEXT KEY long_desc (long_desc); MySQL said: Documentation

#1214 - The used table type doesn't support FULLTEXT indexes

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?

like image 844
Perspolis Avatar asked Dec 24 '22 14:12

Perspolis


2 Answers

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.

See the MYSQL Docs:

Full-text searches are supported for MyISAM tables only. (In MySQL 5.6 and up, they can also be used with InnoDB tables.)

like image 143
Rahul Tripathi Avatar answered Jan 06 '23 18:01

Rahul Tripathi


Simple find in sql file ENGINE=InnoDB replace with ENGINE=MyISAM

It's working fine for me.

like image 41
Chandra Kumar Avatar answered Jan 06 '23 17:01

Chandra Kumar