繁体   English   中英

sphinx索引失败,并要求我使用query_cache_type = 1重新启动服务器以启用它

[英]sphinx index fail, and ask me to restart the server with query_cache_type=1 to enable it

mysql配置my.ini默认query_cache_type = 0。
我已经在sphinx.conf设置了sql_query_pre = SET SESSION query_cache_type=OFF 。我认为索引时打开缓存不是很好,但是sphinx仍然要求我打开缓存...

错误详情:

Win7的X64,狮身人面像2.1.7

I:\sphinx\bin>I:\sphinx\bin\indexer.exe --all --config I:\sphinx\bin\sphinx.conf
Sphinx 2.1.7-id64-release (r4638)
Copyright (c) 2001-2014, Andrew Aksyonoff
Copyright (c) 2008-2014, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file 'I:\sphinx\bin\sphinx.conf'...
indexing index 'test1'...
ERROR: index 'test1': sql_query_pre[1]: Query cache is disabled; restart the server with query_cache_type=1 to enable it
 (DSN=mysql://root:***@localhost:3306/test).
total 0 docs, 0 bytes
total 0.018 sec, 0 bytes/sec, 0.00 docs/sec
skipping non-plain index 'rt'...
total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg

您收到的“消息”来自mysql,而不是sphinx。 索引器仅运行提供的命令并报告/使用结果。

基本上,mysql告诉您查询缓存已被禁用。 尚未全局启用。

因此,尝试仅在(索引)会话中关闭它会失败,因为它没有打开。 如果未在第一时间启用它,则无法禁用它!

http://www.big.info/2013/04/error-code-1651-query-cache-is-disabled.html

它告诉您需要先全局打开它,然后才能关闭它。

也许mysql可能只是默默地未能将其关闭,而不是给出错误,但这是另一回事了。

我遇到了一个错误,实际上是在阻止indexer --all命令生成索引。 我转到XAMPP控制面板,然后单击MySQL模块的“ Config按钮。 这将在记事本中打开文件my.ini 我在文件的[mysqld]部分中添加了以下行:

query_cache_type = 1

然后,我重新启动了MySQL服务。 现在,query_cache_type的值显示为ON,并且indexer --all命令成功生成了索引。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM