[root@localhost mysql]# /usr/lamp/mysql/bin/mysqladmin -u root -p shutdown
Enter password:
/usr/lamp/mysql/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysqld.sock' (2)'
查看'/tmp/mysqld.sock' 文件 是否存在
编译安装mysql 指定的mysqld.sock目录
[root@localhost ~]# /usr/lamp/coreseek/bin/indexer -c /usr/lamp/coreseek/etc/csft.conf --all
Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r2117)]
Copyright (c) 2007-2011,
Beijing Choice Software Technologies Inc (http://www.coreseek.com)
using config file '/usr/lamp/coreseek/etc/csft.conf'...
indexing index 'main'...
ERROR: index 'main': sql_query_pre[1]: Query cache is disabled; restart the server with query_cache_type=1 to enable it (DSN=mysql://root:***@localhost:3306/sphinx).
在sphinx配置文件开启缓存
query_cache_type=1
1 | 要开启mysql的缓存,在mysql配置文件 /etc/my.cnf;Debian和Ubuntu是在/etc/mysql/my.cnf) |
1 2 3 | query_cache_size = 268435456 query_cache_type = 1 query_cache_limit = 1048576 |
以上语句的设置中 query_cache_size 是分配256M内存给Query Cache;query_cache_type=1,是给所有的查询做Cache;query_cache_limit 是指定个别的查询语句1KB的内存。
这些数据可以根据自己的需求作出适当的更改,设置完成之后,保存文档,重新启动MySQL即可。