A
A
andrei20192018-07-01 03:31:37
MySQL
andrei2019, 2018-07-01 03:31:37

Sphinx Indexer not connecting to MySQL?

Some simple malfunction...
Here is the config:

source src1
{
        type = mysql
        sql_host = localhost
        sql_user =root
        sql_pass =
        sql_db = test
        sql_port = 3306
        sql_query = SELECT * FROM test
}

Here is the error:
Sphinx 3.0.3 (commit facc3fb)
...
ERROR: index 'test': sql_connect: failed to load libmysqlclient (or libmariadb)
At the same time from the console and from PHP connects fine:
#mysql test
#mysql -u user -p1 test
$connMYSQL = new PDO('mysql:host=localhost;dbname=test;', 'root', '');

The indexer works with other data sources.
And as I put type = mysql, then after this line in the config it does not read anything (nothing affects).
It looks like there really is an error where the indexer says, something with library versions:
# find / -name libmysqlclient*
/usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.3.9
# find / -name libmariadb*
/usr/lib/x86_64-linux-gnu/libmariadb.so.3

mysql  Ver 15.1 Distrib 10.1.29-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Burov, 2018-07-01
@andrei2019

sphinxsearch.com/forum/view.html?id=15745

Sphinx currently just tries loading libmysqlclient.so (and libmariadb.so now) but does
*not* yet attempt to scan for all the different .so.18 or so.19 or so.20 etc versions.

A
andrei2019, 2018-07-01
@andrei2019

Thanks for the quick response! Did as written here: forum.lazarus.freepascal.org/index.php?topic=3548.15
ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.3.9 /usr/lib/libmysqlclient.so It
worked ! (how lucky I was that the last attempt in the config was from localhost - it only works with it).
But this did not happen with libmariadb.so.3 (perhaps an older version is needed):
Can't connect to local MySQL server through socket '/tmp/mysql.sock' if localhost. (the socket is not there, although root in MySQL has a plugin by default)
Can't connect to MySQL server if name, address, 127... (even though I created a user in MySQL)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question