mysql - 通过 Linux 命令行连接到 SphinxQL

标签 mysql command-line search-engine sphinx

我正在尝试通过 Linux 命令行连接到 SphinxQL 服务器:

> mysql -P 9306

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

我的 Sphinx 配置文件有 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 控制台?

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

最佳答案

'mysql' 客户端,如果检测到 mysql 在 unix-socket 上运行,将完全忽略 -P 参数。所以真的,即使你要求 sphinxQL 端口,你正在连接到 mysql

使用

mysql -P9306 --protocol=tcp

告诉客户端忽略套接字。

专业提示:

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

这是一个有用的持续提醒您连接到 sphinx 而不是 mysql :)

关于mysql - 通过 Linux 命令行连接到 SphinxQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12126948/

相关文章:

java - 在 Mysql 中分发 Java 应用程序

html - HTML 元标记还重要吗?

html - 搜索引擎如何从 html 页面中获取结构化数据?

从 shell 调用 C 函数 (libcanberra)

javascript - 如何告诉搜索引擎自定义 JavaScript 按钮目标 URL?

mysql - SQL查询分组按日期洗牌

mysql - 使用聚合函数为每个数据选择一行

mysql - percona集群第二个节点未启动

linux - 删除文件夹中 lsof 未列出的所有文件

java - 如何在后台运行matlab?