我正在使用最新版本的mySQL服务器,我希望将其连接到Sphinx Search。但是,当我尝试使用“ 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
}
答案 0 :(得分:0)
您似乎正在使用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
答案 1 :(得分:0)
即使Sphinx从较新的服务器中拔出,使用旧版本的mySQL客户端进行连接也可以正常工作。感谢您的帮助。