fn main() {
let id = "root";
let pw = "xx1121!!!!";
let name = "name";
let url = format!("mysql://{id}:{pw}@localhost:3306:{name}");
println!("{:?}", url.trim());
let pool = mysql::Pool::new(url.trim())
.expect("fail");
}
terminal:
"mysql://root:xx1121!!!!@localhost:3306:name"
thread 'main' panicked at 'fail: UrlError { URL ParseError { invalid port number } }', src\main.rs:10:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\rust.exe` (exit code: 101)
I don't know why the error pops up code:
terminal: