Diesel-cli Can't connect to local MySQL server through socket '/tmp/mysql.sock'
ftinkere opened this issue · 1 comments
ftinkere commented
Setup
Versions
- Rust: 1.74.0
- Diesel: 2.1.1
- Database: mysql
- Operating System MacOS 14.0 (Apple Silicon)
Feature Flags
- diesel: mysql
Problem Description
Diesel cli not working right
What are you trying to accomplish?
diesel setup
or
diesel setup --database-url 'mysql://user:secret@localhost:3306/yordan'
What is the expected output?
I don't know successful output
What is the actual output?
Creating database: yordan
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Are you seeing any additional errors?
No
Steps to reproduce
- I have install diesel cli (https://diesel.rs/guides/getting-started.html)
- Added diesel and dotenvy to cargo.toml
- Install MySQL in docker with exposed port 3306
- Added
DATABASE_URL=mysql://user:secret@localhost:3306/yordan
in .env
If try with --database-url
output no change
mysql://localhost:3306/yordan?user_name=user&password=secret
try too
Checklist
- [+] I have already looked over the issue tracker and the discussion forum for similar possible closed issues.
- [+] This issue can be reproduced on Rust's stable channel. (Your issue will be
closed if this is not the case) - [+] This issue can be reproduced without requiring a third party crate