Home > Database > Mysql Tutorial > MySQL中文索引插件mysqlcft安装及使用_MySQL

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:30:34
Original
1390 people have browsed it

bitsCN.com

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

 

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

 

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

 

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

 

 从命令行登入MySQL服务器

 

 查看MySQL插件目录

 

Show variables like ‘plugin_dir’;
Copy after login

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

下载mysqlcft中文索引插件,解压后复制mysqlcft.so文件到MySQL的插件目录下

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

开始安装mysqlcft.so插件

Install plugin mysqlcft soname ‘mysqlcft.so’;
Copy after login

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

show plugins;
Copy after login

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

4.卸载mysqlcft.so插件,卸载前请先删除使用mysqlcft建立的全文索引。

uninstall plugin mysqlcft;
Copy after login

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

创建单列全文索引

alter ignore table 数据库名.表名 add fulltext index 全文索引名(字段名) with parser mysqlcft;
Copy after login

创建全文联合索引

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

6.查询使用样例

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

 


bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template