簡體   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