elixir-ecto / myxql

MySQL 5.5+ driver for Elixir
Apache License 2.0
271 stars 66 forks source link

Unable to connect to sphinxsearch server #178

Closed Slavenin closed 6 months ago

Slavenin commented 6 months ago

Hello! I'm trying to connect to the server sphinxsearch (https://sphinxsearch.com)

If I use the config:

{MyXQL,
       name: :mysql_sphinx_client,
       hostname: Application.get_env(:giza_sphinxsearch, :host, "localhost"),
       port: Application.get_env(:giza_sphinxsearch, :sql_port, 9306),
       password: nil,
       show_sensitive_data_on_connection_error: true,
       username: ""}

error appears:

11:35:04.408 [error] Process #PID<0.374.0> terminating
** (CaseClauseError) no case clause matching: {:ok, {:error, {:server_missing_capability, :client_plugin_auth}}}
    (myxql 0.6.4) lib/myxql/connection.ex:28: MyXQL.Connection.connect/1
    (db_connection 2.6.0) lib/db_connection/connection.ex:92: DBConnection.Connection.handle_event/4
    (stdlib 5.0.2) gen_statem.erl:1379: :gen_statem.loop_state_callback/11
    (stdlib 5.0.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3

if username: nil

** (RuntimeError) :username is missing
    (myxql 0.6.4) lib/myxql/client.ex:38: MyXQL.Client.Config.new/1
    (myxql 0.6.4) lib/myxql/connection.ex:26: MyXQL.Connection.connect/1
    (db_connection 2.6.0) lib/db_connection/connection.ex:92: DBConnection.Connection.handle_event/4
    (stdlib 5.0.2) gen_statem.erl:1379: :gen_statem.loop_state_callback/11
    (stdlib 5.0.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3

but the sphinx server connection does not require login and password, just port and host.

How i can connect to the server?

wojtekmach commented 6 months ago

Thank you for the report. Could you try latest master?

{:myxql, github: "elixir-ecto/myxql"}
Slavenin commented 6 months ago

Thanks for the quick response, but nothing has changed

wojtekmach commented 6 months ago

We are only testing against MySQL and MariaDB and rely on broader community for support for different servers. Maybe try getting help on ElixirForum and similar where broader community might be able to help. I’ll close this as it’s not on our immediate roadmap but feel free to continue the discussion.

Slavenin commented 5 months ago

Hello!

Why did you hardcode the use of the authorization plugin in file https://github.com/elixir-ecto/myxql/blob/master/lib/myxql/protocol.ex#L114? Isn't other behavior possible? Is it possible to make a setting in the configuration to use login/passwordless connection?