-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
error: Could not compile mysqlclient-sys
.
#1286
Comments
Try setting |
I'm having the same issue on Windows 10 x64. UPDATE: However, it's possible to disable building the MySQL support by specifing "--no-default-features --features postgres" on the cargo commandline, so if you aren't using MySQL that would solve this particular issue. Now I'm getting a linking error on libpq.lib instead. (presumably unrelated to this issue) UPDATE 2: |
We call this out explicitly in the getting started guide |
for anyone wanting to actually use MySQL and who is having issues running cargo install, just to clarify adding the location of E.g.
|
Tips: |
@shijunti19 That's certainly a configuration issue because it's working on our CI. See the CI setup for an example how to set those variables. |
The way the getting started docs are set up will fail for many first time users. We might be better off just having I think this will be a much better first experience. We shouldn't force people to install mysql like that because we can't assume what database they want to use. Maybe we can prompt for what database driver they want on |
@savovs I don't think its a good idea to simplify the setup of one supported back end at the cost of making the setup of the other two targets more difficult. |
设置这些环境变量:
在命令提示符或PowerShell中输入以下内容: ` setx SQLITE3_LIB_DIR "C:\SQLite" setx MYSQLCLIENT_LIB_DIR "C:\Program Files\MySQL\MySQL Connector C 6.1\lib\vs14" 注意:您可能必须根据这些文件在PC中的位置更改路径:
删除:C:\Users**\AppData\Local\Temp\cargo-insta 文件
|
I'm having the same issue on Windows 7 x64. |
This works. Note: use |
Please download mysqlclient from: https://downloads.mysql.com/archives/c-c/ |
for those people on osx brew install mysql did the trick for me |
For those that still have errors on Windows, you need to install the MySQL Server (but you can skip/cancel the configuration if you do not actually want to run a server). I don't know if the old library in the connector/c archive is the same than this library, but the server version worked for me. |
Re: Diesel CLI on Windows 10 for MySQL. If the above advice doesn't work for you, this worked for me:
This may not be ideal, but it worked for me. |
I created a guide |
This worked for me, thanks. |
I'm using Windows 11. In my case, I installed the latest MySQL server with the C/C++ connector. Then set an environment variable |
cargo clean |
Still no joy. I have MySQL Server 8.0 installed and have set MYSQL_LIB_DIR to C:\Program Files\MySQL\MySQL Server 8.0\lib. I have checked to make sure the mysqlclient.lib file is there. |
mysql8 does not support x86_64,how to solve this problem? |
Hello everybody,
Just pointing out that some of these steps may not be necessary, but I didn't have time to test each one more carefully. |
cargo install diesel_cli, error:
error: could not find native static library
mysqlclient
, maybe an -L flag is missing?error: Could not compile
mysqlclient-sys
.……………………
mysql version 5.7
win7 x64
rust 1.22.0-nightly
The text was updated successfully, but these errors were encountered: