美文网首页
Mac报错:找不到mysql_config

Mac报错:找不到mysql_config

作者: 卫青臣 | 来源:发表于2022-12-12 18:40 被阅读0次

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

相关文章

网友评论

      本文标题:Mac报错:找不到mysql_config

      本文链接:https://www.haomeiwen.com/subject/ogdcqdtx.html