我一直在尝试使用 安装 Rust Diesel CLI 工具cargo install diesel_cli,但安装失败并出现链接错误
ld: library not found for -lmysqlclient
clang: error: linker command failed with exit code 1
(use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
我安装使用自制的MySQL客户端:brew install mysql-client。在安装过程中,我收到以下警告:
mysql-client is keg-only, which means it was not symlinked into /usr/local,
because conflicts with mysql.
If you need to have mysql-client first in your PATH run:
echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile
For compilers to find mysql-client you may need to set:
export LDFLAGS="-L/usr/local/opt/mysql-client/lib"
export CPPFLAGS="-I/usr/local/opt/mysql-client/include” …Run Code Online (Sandbox Code Playgroud)