日期:2014-05-16  浏览次数:20657 次

sphinx + mysql 快速上手
1 下载sphinx 0.9.9
2 解压到D:\
3 在D:\sphinx\下创建文件夹 data 和 log
4 复制sphinx-min.conf.in到bin文件夹并改名为sphinx.conf
5 修改sphinx.conf中的数据源配置 如下
	sql_host				= localhost
	sql_user				= root
	sql_pass				= 1234
	sql_db					= test
	sql_port				= 3306	# optional, default is 3306

6 执行数据库脚本example.sql
7 在DOS窗口执行indexer.exe --all

执行成功的话在data目录下会产生数据文件

可能遇到的错误
1 ERROR: index 'test1': column number 1 has no name.
2 ERROR: index 'test1': sql_connect: Access denied for user 'xuly'@'localhost'

直接搜索可知道答案

sphinx 0.9.9支持mysql 5.1.X
0.9.9一下的版本可能不支持mysql 5.1.X