Search code examples
mysqlwindowssearchsphinx

Unable to connect mySQL to Sphinx Search


I'm using the most recent version of a mySQL server, I wish to connect it to Sphinx Search. However, when I attempt to connect to the server through CMD with "SphinxQL" I encounter:

ERROR 200 (HY000): Unknown MySQL error

This is by trying:

searchd -P9306

And receiving:

[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

However, I can connect the same way to port 3306 and successfully get into the base mySQL server. I heard there's some difference between the way Sphinx and SQL hold passwords so I've used users with both mysql_native_password and the newer version to no avail.

The Indexer runs fine, though when I go to rotate the indexes specifically I encounter an error regarding failing to open a pid_file. This may not be related.

Below is my code snip:

#
# 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
}

Solution

  • Using a older version of mySQL client just to connect works perfectly, even with a newer server being pulled from by Sphinx. Thanks for the help guys.