This theme is built |

小七闲

园龄:6年3个月粉丝:2关注:7

2020-08-26 17:09阅读: 1011评论: 0推荐: 0

Centos下执行make时出现mysql.h: No such file or directory

问题概述:起因是为了方便直接用宝塔安装了php和mysql,然后项目需要开启pdo_mysql,却发现没有这个拓展包,于是手动去下载该拓展包进行编译。但是执行make命令时出现了问题,报错如下:

 #include <mysql.h>

compilation terminated.
make: *** [pdo_mysql.lo] Error 1

应该是找不到mysql.h,但是系统已经装了mysql,应该是有包含该文件的,所以先看下该文件是否存在。

  1. 执行find命令查找该文件
    find / -name mysql.h
    得到该文件路径/www/server/mysql/include/mysql.h
    ps:这是宝塔安装的路径,因此会与默认路径不一致
  2. 建立软连接,执行
    ln -s /www/server/mysql/include/* /usr/local/include/
    说明:这里的 /www/server/mysql/include/* ,是你的mysql路径/include/*,而/usr/local/include/是原默认路径,可以不更改

本文作者:小七闲

本文链接:https://www.cnblogs.com/inkqx/p/13566250.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   小七闲  阅读(1011)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起
  1. 1 2020.8.30 GIN
  2. 2 久遠 ~光と波の記憶~(Arrange Version) 松枝賀子 / 江口貴勅
2020.8.30 - GIN
00:00 / 00:00
An audio error has occurred, player will skip forward in 2 seconds.