MySQL中文索引插件mysqlcft安装及使用

1.MySQL必须是动态编译安装的,以便加载动态链接库。

2.编辑MySQL配置文件my.cnf,在[mysqld]段中加入ft_min_word_len=1(意为最小词所占字节数)

 3.安装mysqlcft中文全文索引插件

从命令行登入MySQL服务器 

查看MySQL插件目录

Show variables like ‘plugin_dir’;
MySQL中文索引插件mysqlcft安装及使用
下载mysqlcft中文索引插件,解压后复制mysqlcft.so文件到MySQL的插件目录(/user/lib/mysql/plugin)下

https://code.google.com/p/mysqlcft 有32位与64位可选

开始安装mysqlcft.so插件

Install plugin mysqlcft soname ‘mysqlcft.so’;

查看mysqlcft.so插件是否安装成功

show plugins;
MySQL中文索引插件mysqlcft安装及使用
4.卸载mysqlcft.so插件,卸载前请先删除使用mysqlcft建立的全文索引。
uninstall plugin mysqlcft;

5.为已经存在的表添加mysqlcft中文全文索引


创建全文联合索引

alter ignore table 数据库名.表名 add fulltext index 全文联合索引名(字段名1,字段名2) with parser mysqlcft;

6.查询使用样例

Select * from table where match(title) against(‘北京’ in Boolean mode);


相关文章:

  • 2021-10-14
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2022-02-11
  • 2021-11-17
  • 2021-11-17
猜你喜欢
  • 2022-12-23
  • 2021-07-06
  • 2021-07-07
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2021-04-25
相关资源
相似解决方案