-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Mysql #40
Comments
@thegenius Thank you for opening this. Can you confirm that you can connect to mysql using the command line? I tested your example locally and it works if your password is right but blocks forever if its not. That's definitely a bug that needs fixing. We need to add an integration test of "bad password" (probably for both mysql and postgres to make sure we're handling that error response from the database correctly). |
Also can you confirm your MySQL version? |
@mehcode So happy to get response from you. I think this library is on the right way to make rust excellent. And I'm glad to join in. Maybe the first step is helping test the library. And join you in the future. |
We've confirmed the bug and have a small test case that is reproducible. Basically, you're hitting a bug in the A quick work-around to help if you still can't connect is to try opening a regular connection just before the pool. That will give you a proper error message so you can debug your connection issue. #[async_std::main]
async fn main() -> anyhow::Result<()> {
// Open a new connection and immediately drop it
let _ = MySqlConnection::open(
"mysql://root:123456@localhost:3306/test"
).await?;
let pool_result = MySqlPool::new(
"mysql://root:123456@localhost:3306/test"
).await;
let mut pool = match pool_result {
Ok(p) => p,
Err(_) => panic!("pool create faild")
};
// [...]
} As for the actual fix, that will be up in the next couple days. We've discovered a couple other corner cases in the Pool while going through it and will be fixing those as well before we make a release. Thanks again for the report. 🙇♂️ |
This should be fixed in v0.1.4 |
I'am new to this library and try to write an mysql example.
Cargo.toml:
async-std = { version = "1.4.0", features = [ "attributes" ] }
sqlx = {version = "0.1.3", features = [ "mysql" ]}
anyhow = "1.0.26"
From this example, maybe mysql support is poor, maybe there is some bug in this library.
I open this issue to request for more mysql support.
The text was updated successfully, but these errors were encountered: