Erik Schierboom
Erik Schierboom

Reputation: 16636

Cannot connect to Sphinx through MySQL connection

I was trying to connect to a Sphinx search server using its MySQL interface. However, once I tried to connect, the following exception was thrown by the MySQL .NET connector: Connector/Net no longer supports server versions prior to 5.0

I can successfully connect to the MySQL interface using the command-line mysql command on the server. How can I use the .NET connector to connect to the Sphinx MySQL interface>

Upvotes: 0

Views: 1203

Answers (1)

Erik Schierboom
Erik Schierboom

Reputation: 16636

The problem is that by default, Sphinx returns a MySQL version of 2.0.4 and that most recent MySQL .NET connectors require a MySQL version of 5.0+. However, one can make Sphinx return a different MySQL version by modifying the sphinx.conf file. Just add the following line to the searchd configuration section of the sphinx.conf file:

mysql_version_string = 5.0.37

Of course, you can use any version you'd like. After the configuration has been edited, do a restart of sphinx:

searchd --stop
searchd

Try connecting again and the .NET connector will see a compatible MySQL version returned by Sphinx and everything works!

Upvotes: 2

Related Questions