centos7.3yum安装mysql后缺少mysql.h头文件

1.yum search mysql //查找mysql的依赖

然后会显示已安装和未安装的依赖库
查找与头文件相关的依赖库
[root@10-254-0-161 dc2-user]# yum search mysql | grep “header files”
mysql-community-devel.i686 : Development header files and libraries for MySQL
mysql-community-devel.x86_64 : Development header files and libraries for MySQL
mysql-community-embedded-devel.i686 : Development header files and libraries for
mysql-community-embedded-devel.x86_64 : Development header files and libraries

2.发现一个库没安装,则找到对应库的名字安装它

执行:sudo yum install mysql-community-devel.x86_64

(该库英文说明Development header files and libraries for MySQL database client applications)

这库的功能就是为了提供头文件的功能。

3.最后再编译下程序就没问题了。

你可能感兴趣的:(centos7.3,mysql)