MySQL setting full-text index

CSDN Q & A 2022-02-13 09:01:18 阅读数:282

mysql setting full-text text index

Why can't my full-text index be created directly when creating a table ? Prompt syntax error when running mysql The version is 8.0 But my has no problem creating full-text indexes on existing tables

img
The code is as follows :CREATE TABLE t_class10(
classno INT(4),
cname VARCHAR(20),
loc VARCHAR(40),
FULLINDEX INDEX index_loc(loc)
);

Error message : Error Code: 1064. You have an error in your SQL syntax; check the manual that 0.000 seccorresponds to your MySQL server version for the right syntax to use near 'INDEX index_loc(loc) )' at line 5




Take the answer :

CREATE TABLE article (
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
body TEXT,
FULLTEXT(title, body)
) TYPE=MYISAM;


copyright:author[CSDN Q & A],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130901161686.html