jmoiron / sqlx

general purpose extensions to golang's database/sql
http://jmoiron.github.io/sqlx/
MIT License
16.3k stars 1.09k forks source link

mysql connect error #896

Closed zigaai closed 1 year ago

zigaai commented 1 year ago

i use sea-orm to connect mysql, it cannot connet. but when i use other client, its work mysql_version: 5.7.23-log url: mysql://root:123456@172.16.90.27:31295/demo

sqlx version: 0.7.2 sea-orm version: 0.12.3

error stack:

thread 'main' panicked at 'connect database error!: Conn(SqlxError(Tls(Os { code: -2146893018, kind: Uncategorized, message: "接收到的消息异常,或格式不正确。" })))', src\config\db.rs:44:41
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\std\src\panicking.rs:593
   1: core::panicking::panic_fmt
             at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\core\src\panicking.rs:67
   2: core::result::unwrap_failed
             at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library\core\src\result.rs:1651
   3: enum2$<core::result::Result<enum2$<sea_orm::database::db_connection::DatabaseConnection>,enum2$<sea_orm::error::DbErr> > >::expect<enum2$<sea_orm::database::db_connection::DatabaseConnection>,enum2$<sea_orm::error::DbErr> >
             at /rustc/eb26296b556cef10fb713a38f3d16b9886080f26\library\core\src\result.rs:1033
   4: simple_code_gen::config::db::init::async_fn$0
             at .\src\config\db.rs:44
   5: simple_code_gen::config::init::async_fn$0
             at .\src\config\mod.rs:36
   6: simple_code_gen::main::async_block$0
             at .\src\main.rs:15

rust:

$ cargo -V
cargo 1.71.1 (7f1d04c00 2023-07-29)
$ rustup -V
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.71.1 (eb26296b5 2023-08-03)`

other client connect status: image

mohammed90 commented 1 year ago

Wrong sqlx. This repo is for a Go library, not Rust.

zigaai commented 1 year ago

oops, i'm sorry