mac报错:找不到mysql_config
需要安装mysql-client:
1、 brew换国内源:
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
2、安装mysql-client: brew install mysql-client
安装后目录:/usr/local/Cellar/mysql-client/
3、添加系统环境变量
export PATH=$PATH:/usr/local/Cellar/mysql-client/8.0.31/bin
3、 检查 /usr/local/Cellar/mysql-client/8.0.31/bin/mysql_config 文件120行左右内容:
# Create options
libs="-L$pkglibdir"
libs="$libs -lmysqlclient -lssl -lcrypto" # 这里缺失就需要补充(用sudo vim)
4、复制mysql.h文件
cd /usr/local/Cellar/mysql-client/include/mysql/
cp mysql.h mysql_config.h
网友评论