blackbeam / rust-mysql-simple

Mysql client library implemented in rust.
Apache License 2.0
666 stars 145 forks source link

Unknown authentication protocol: `mysql_clear_password` #344

Closed liheinz closed 1 year ago

liheinz commented 1 year ago

Hi there,

I am trying to retrieve data from a mysql server with r2d2 . The server requires Client-Side Cleartext Pluggable Authentication

But I get

DriverError { Unknown authentication protocol: mysql_clear_password }

Is this a missing plugin in the driver ?

Best Linus

blackbeam commented 1 year ago

@linusheinz, hi!

Could you please try this branch?

The following should do the job:

In your Cargo.toml:

[patch.crates-io]
mysql = { git = "https://github.com/blackbeam/rust-mysql-simple", branch = "cleartext-password" }

Within your code:

// ...

// Enable mysql_clear_password via OptsBuilder
let opts = opts_builder.enable_cleartext_password(true);

// or alternatively enable mysql_clear_password via connection URL
let opts = Opts::from_url("mysql://shome_host/some_db?enable_cleartext_plugin=true")?;

// ...
cobyge commented 1 year ago

Hey, I'm not the original commenter, but I tried out the branch and can confirm that it works as intended 😄

I also need this feature, so I'd be happy to help get it get merged if something else needs to be done