gpt4 book ai didi

mysql - 无法将 mySQL 连接到 Sphinx 搜索

转载 作者:行者123 更新时间:2023-11-29 17:05:19 27 4
gpt4 key购买 nike

我正在使用最新版本的 mySQL 服务器,我希望将其连接到 Sphinx 搜索。但是,当我尝试使用“SphinxQL”通过 CMD 连接到服务器时,我遇到:

ERROR 200 (HY000): Unknown MySQL error

这是通过尝试:

searchd -P9306

并接收:

[Wed Aug 29 10:41:28.893 2018] [22560] listening on 127.0.0.1:9312
[Wed Aug 29 10:41:28.893 2018] [22560] listening on all interfaces, port=9306
[Wed Aug 29 10:41:28.959 2018] [22560] WARNING: No extra index definitions found in data folder
[Wed Aug 29 10:41:28.965 2018] [22560] accepting connections
[Wed Aug 29 10:41:28.966 2018] [21976] prereading 2 indexes
[Wed Aug 29 10:41:28.966 2018] [21976] prereaded 2 indexes in 0.000 sec

但是,我可以以相同的方式连接到端口 3306 并成功进入基本 mySQL 服务器。我听说 Sphinx 和 SQL 保存密码的方式有些不同,因此我使用了 mysql_native_password 和较新版本的用户,但没有效果。

索引器运行良好,但当我专门旋转索引时,我遇到了有关无法打开 pid_file 的错误。这可能不相关。

下面是我的代码片段:

#
# Minimal Sphinx configuration sample (clean, simple, functional)
#

source src1
{
type = mysql

sql_host = localhost
sql_user = test
sql_pass = test123
sql_db = test
sql_port = 3306 # optional, default is 3306

sql_query = SELECT id, name, storage, colour, network, quality, price, UNIX_TIMESTAMP() AS last_modified FROM phones
# UNIX_TIMESTAMP() AS

sql_attr_timestamp = last_modified
}


index test1
{
source = src1
path = C:/Program Files/sphinx-3.0.3/data/test1
}


index testrt
{
type = rt
rt_mem_limit = 128M

path = C:/Program Files/sphinx-3.0.3/data/testrt

rt_field = id
rt_field = name
rt_field = storage
rt_field = colour
rt_field = network
rt_field = condition
rt_field = price
rt_field = last_modified
rt_attr_uint = gid
}


indexer
{
mem_limit = 128M
}


searchd
{
mysql_version_string = 5.0.37
listen = localhost:9312
listen = 9306:mysql41
log = C:/Program Files/sphinx-3.0.3/log/searchd.log
query_log = C:/Program Files/sphinx-3.0.3/log/query.log
read_timeout = 5
max_children = 30
pid_file = C:/Program Files/sphinx-3.0.3/log/searchd.pid
seamless_rotate = 1
preopen_indexes = 1
unlink_old = 1
workers = threads # for RT to work
binlog_path = C:/Program Files/sphinx-3.0.3/data
}

最佳答案

看起来您正在使用 mysql 8 客户端。 Sphinx 尚不兼容。您可能想尝试 Manticore Search(Sphinx 的一个分支)。

[root@sehs01 mysql-8.0.11-el7-x86_64]# ./bin/mysql --version
./bin/mysql Ver 8.0.11 for el7 on x86_64 (MySQL Community Server - GPL)

[root@sehs01 mysql-8.0.11-el7-x86_64]# ./bin/mysql -hse01 -P6312
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 2.7.2 58d96fd@180822 dev

关于mysql - 无法将 mySQL 连接到 Sphinx 搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52081872/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com