blackbeam / rust-mysql-simple

Mysql client library implemented in rust.
Apache License 2.0
658 stars 144 forks source link

DriverError #290

Closed QMHTMY closed 3 years ago

QMHTMY commented 3 years ago

thread 'main' panicked at 'called Result::unwrap() on an Err value: DriverError { Could not connect to address `root:3306': failed to lookup address information: Name or service not known }

let url = "mysql://root:#*Shieber2021@localhost:3306/test";
let opts = Opts::from_url(url).unwrap();
let pool = Pool::new(opts).unwrap();
let mut conn = pool.get_conn().unwrap();

I am wondering if the characters "#*" in password caused such an error?

blackbeam commented 3 years ago

Hi. Yeah, special chars in URLs should be urlencoded (try mysql://root:%23%2AShieber2021@localhost:3306/test)