Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Trouble connecting to MySQL server:
I'm trying to connect to a MySQL server on Dreamhost shared hosting. Error message is:
Server side error message:
DriverError { Unknown authentication protocol: `sha256_password` }
This seems to indicate that the mysql crate is sending a different kind of authentication than the server expects. Here's the login setup:
let opts = mysql::OptsBuilder::new()
.enable_cleartext_plugin(true)
.secure_auth(false)
.ip_or_hostname(creds.get("DB_HOST"))
.tcp_port(portnum)
.user(creds.get("DB_USER"))
.pass(creds.get("DB_PASS"))
.db_name(creds.get("DB_NAME"));
I've tried this with and without disabling secure_auth.
I tried what the documentation says is the correct OpsBuilder functions for that, but it doesn't help.
MySQL version: 8.0.28-0ubuntu0.20.04.3
Note that this is shared hosting. I can't look at mysql.user to see auth modes.
It's been reported as a mysql crate issue previously by someone else. But there's no reply on Github.
3 posts - 2 participants
๐ท๏ธ Rust_feed