区分MySQL和Sphinx搜索


Differentiate MySQL and Sphinx searchd

我在端口 9312 和 9306 (mysql41) 上运行 Sphinx 搜索服务器,我使用以下代码连接到服务器以使用 SphinxQL:

$mysqli = new mysqli($hostname, $username, $password, $database, "9306");

当我发送 SQL 语句时,它给了我结果并且一切正常(显然),但是如果我将端口从 9306 更改为任何其他数字(例如 1111),它仍然给我结果,所以我无法检查我是否真的连接到端口 9306 的搜索守护程序,或者我仍然连接到端口 3306 的 mysql 服务器。

有什么想法吗?

感谢您的提前。

http://us3.php.net/mysqli_get_server_info

应该是一种可靠的方法:)

但也要看到http://sphinxsearch.com/docs/current.html#conf-mysql-version-string