在 mac OS 中安装 mysqlclient 库

installing the mysqlclient library in mac OS

我正在尝试使用 diesel.rs 库演示 Rust 数据库程序。

我正在执行入门步骤 here

如本页所述,我在 运行 命令 cargo install diesel_cli 时遇到以下错误。

note: ld: library not found for -lmysqlclient
clang: error: linker command failed with exit code 1 (use -v to see invocation)

解决方案在下一步和下面的同一页中给出。

   You can resolve this issue by either installing the library (using the usual way to do this depending on your operating system) or by specifying the backends you want to install the CLI tool with.

但我不知道如何在 mac OS 中执行此操作。我尝试了以下命令。

brew install mysqlclient
brew install lmysqlclient

但是 brew 找不到任何这样的 repo。 请帮助我如何解决此错误并在我的 mac OS.

中安装 mysqlclient 库

mysql-connector-c seems to be the homebrew package you are looking for. Libmysqlclient should also be installed when installing the mysql 酿造包。