set new value for “ft_min_word_len ” FULLTEXT in mysql

烂漫一生 提交于 2019-11-30 18:07:49

You should change this system parameter, restart server and then rebuild ALL FULLTEXT indexes.

REPAIR TABLE <TableName> QUICK;

This is what I use for getting all needed repair commands:

SELECT DISTINCT CONCAT("REPAIR TABLE `", TABLE_SCHEMA, "`.`", 
TABLE_NAME, "` QUICK;") FROM information_schema.STATISTICS 
WHERE index_type = 'FULLTEXT';

I think you should try altering table by drop index and again add index. It will surely work.

I just had and solved a similar problem of my own. The problem in my case is that the my.ini file I needed to edit in order to change the ft_min_word_len variable was in a directory that's hidden/protected by default in Windows 7. That's: "c:/programdata/mysql/mysql server 5.7".

Windows file explorer and searches don't show this location until you go into folder options and specify that you want to see hidden files/folders (and possibly protected operating system files--I did both).

Initially I created a my.cnf file under Program Files/MySQL Server 5.7. But when I restarted the server the ft_min_word_len variable hadn't changed. Then I typed in some random text that I knew should trigger an error, but the server started up like normal. It seems that MySQL wasn't reading the file, even though it was in one of the locations specified in the help text from the MySQL client shell.

My thinking is that the MySQL server starts searching for .cnf/.ini files in the order specified in the help text, but once it finds a valid file, stops searching. Just a theory, but I can say for sure that it wasn't recognizing configuration files in the other places it was supposed to be looking.

I figured it was like CSS, where each new CSS file overrides settings in the previous. Evidently not.

Anyway, I hope this will be of help to anyone else who runs into the same problem.

Mahedi Hasan

You could just drop and add the FULLTEXT index

or do it in stages and see how big it will get in advance

CREATE TABLE models_new LIKE models;

ALTER TABLE models_new DROP INDEX name;

ALTER TABLE models_new ADD FULLTEXT name (name);

ALTER TABLE models_new DISABLE KEYS;

INSERT INTO models_new SELECT * FROM models;

ALTER TABLE models_new ENABLE KEYS;

ALTER TABLE models RENAME models_old;

ALTER TABLE models_new RENAME models;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!