通过Linux的命令行连接到SphinxQL(Connect to SphinxQL through

2019-06-27 09:41发布

我试图连接到Linux的通过命令行这样SphinxQL服务器:

> mysql -P 9306

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

我的狮身人面像的配置文件有2项听:

listen                  = 9312
listen                  = 9306:mysql41

searchd的守护进程正在运行:

> ps ax | grep searchd
10727 ?        S      0:00 /usr/local/sphinx/bin/searchd
10728 ?        Sl     0:00 /usr/local/sphinx/bin/searchd

常规的搜索查询工作完美:

> /usr/local/sphinx/bin/search StackOverflow | more

Sphinx 2.0.4-release (r3135)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/usr/local/sphinx/etc/sphinx.conf'...
index 'test1': query 'StackOverflow ': returned 2 matches of 2 total in 0.009 sec

displaying matches:
1. document=1788212, weight=1797
        id=1788212
...

所以,我在做什么错? 我怎样才能获得SphinxQL控制台?

任何暗示将不胜感激。 提前致谢!

Answer 1:

在“MySQL的客户,会完全忽略-P PARAM,如果它检测到MySQL是在UNIX插槽运行。 即使你问sphinxQL端口所以真的,你连接到MySQL

使用

mysql -P9306 --protocol=tcp

告诉客户端忽略插座。

专家提示:

mysql -P9306 --protocol=tcp --prompt='sphinxQL> '

它作为一个有用的不断提醒你连接到狮身人面像不mysql的:)



Answer 2:

对我的作品:

mysql -P 9306 -h 0


Answer 3:

我最近遇到了这一点。 我能够通过注释掉通过mysql外壳获得在狮身人面像listen未指定MySQL配置。 这可能不适合你,如果你仍然需要去searchd通过API。



文章来源: Connect to SphinxQL through Linux command-line