社区
Linux/Unix社区
帖子详情
Centos7下报错fatal error :mysql.h:No such file or directory 已解决!!!
烟柳垂痕
2019-06-11 07:27:07
在Linux发行版本中Centos 7采用yum命令来安装.rpm的包和依赖! 我们在安装MySQL数据库后,编写C程序,在.c头文件中调用#include<mysql.h>,编写好运行编译时通常会出现一下错误: fatal error :mysql.h:No such file or directory 如图所示: 通常情况下是缺少libmysqlclient-dev 依赖包所致,这时普通用户下用sudo yum install mysql-devel,root用户直接yum install mysql-devel安装依赖包后即可解决!如下图所示! 再次运行.c文件时需要引用指定目录下得文件,使用whereis mysql检索mysql文件路径,编译时需要加上-lmysqlclient才不会报引用错误!如下图所示!
...全文
2128
回复
打赏
收藏
Centos7下报错fatal error :mysql.h:No such file or directory 已解决!!!
在Linux发行版本中Centos 7采用yum命令来安装.rpm的包和依赖! 我们在安装MySQL数据库后,编写C程序,在.c头文件中调用#include<mysql.h>,编写好运行编译时通常会出现一下错误: fatal error :mysql.h:No such file or directory 如图所示: 通常情况下是缺少libmysqlclient-dev 依赖包所致,这时普通用户下用sudo yum install mysql-devel,root用户直接yum install
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
MySQL
-Python安装问题小记
安装完
mysql
-python后import加载模块提示以下错误, 代码如下: Import
Error
: lib
mysql
client_r.so.16: cannot open shared object
file
: No such
file
or
directory
于是google之,总结一下
解决
方法: (1)在
mysql
-ython的安装目录下找到site.cfg,将 #
mysql
_config = XXXXXXXXXXXXXXXX 注释符号去掉,并填上
mysql
_config的地址 (2)将
mysql
/lib下所有关于lib
mysql
client的so文件软链接到/usr/li
centos7
安装
Mysql
.zip
python和数据库交互的不二之选(
mysql
db在windows和Linux安装
报错
时的
解决
方法,内含linux需要的安装资源)
致命错误(
mysql
mysql
.h)没有那个文件或目录
解决
办法.pdf
。。。
ubuntu-version `GLIBC-2.25` not found.pdf
ubuntu ubuntu_version `GLIBC_2.25` not found
php-5.6.29.tar.gz
编译 ./configure --prefix=/usr/local/php --exec-prefix=/usr/local/php --bindir=/usr/local/php/bin --sbindir=/usr/local/php/sbin --includedir=/usr/local/php/include --libdir=/usr/local/php/lib/php --mandir=/usr/local/php/php/man --with-config-
file
-path=/usr/local/php/etc --with-
mysql
-sock=/var/run/
mysql
/
mysql
.sock --with-mcrypt=/usr /i nclude --with-mhash --with-openssl --with-
mysql
=shared,
mysql
nd --with-
mysql
i=shared,
mysql
nd --with-pdo-
mysql
=shared,
mysql
nd --with-gd --with-iconv --with-zlib --enable-zip --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-mbregex --enable-mbstring --enable-ftp --enable-gd-native-ttf --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg-dir --with-freetype-dir --enable-opcache --enable-fpm --enable-fastcgi --with-fpm-user=www --with-fpm-group=www --without-gdbm --with-mcrypt=/usr/local/apps/libmcrypt --disable-
file
info
报错
:1, **configure:
error
: system libzip must be upgraded to version >=**0.11。 使用Yum最新版只到0.10,不足以达到要求。 一、先删除libzip yum remove libzip -y SSH执行以上命令,先删除libzip 和 libzip-devel 二、下载安装并手动编译 wget https://nih.at/libzip/libzip-1.2.0.tar.gz tar -zxvf libzip-1.2.0.tar.gz cd libzip-1.2.0 ./configure make && make install 三、(可忽略)另外最新版本请参考官网:https://nih.at/libzip/ 1.5.0的libzip需要cmake wget https://libzip.org/download/libzip-1.5.0.tar.gz tar -zxvf libzip-* cd libzip* mkdir build && cd build && cmake .. && make && make install
报错
2:
error
: off_t undefined; check your library configuration 根据
报错
信息分析 configure:
error
: off_t undefined; check your library configuration 未定义的类型 off_t。 off_t 类型是在 头文件 unistd.h中定义的,在32位系统 编程成 long int ,64位系统则编译成 long long int ,这里题主的系统应该是 64位的吧,在进行编译的时候 是默认查找64位的动态链接库,但是默认情况下 centos 的动态链接库配置文件/etc/ld.so.conf里并没有加入搜索路径,这个时候需要将 /usr/local/lib64 /usr/lib64 这些针对64位的库文件路径加进去。 采用下面的方法。 添加搜索路径到配置文件 echo '/usr/local/lib64 /usr/local/lib /usr/lib /usr/lib64'>>/etc/ld.so.conf 然后 更新配置 ldconfig -v 再次执行 编译 成功 执行安装: make && make install
报错
: /usr/local/include/zip.h:59:21:
fatal
error
: zipconf.h: No such
file
or
directory
解决
: cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h 1 安装成功: 复制配置文件: cp php.ini-production /usr/local/php/lib/php.ini cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf ln -s /usr/local/php/sbin/php-fpm /usr/local/bin 修改配置: cd /usr/local/php/etc/php-fpm.d vim www.conf [www] //池子名 (pool) 设置 ;listen = /tmp/php-fcgi.sock // 监听的地址,可以监听socket ,也可以监听端口 listen = 127.0.0.1:8089 或者这样写,php-fpm 通常在本地使用,php和nginx 通常在一台机器,所以可写127.0.0.1,别的机器 连接,需用本机ip listen.mode = 666 //sock 文件的权限 listen.owner = nobody listen.group = nobody user = php-fpm group = php-fpm pm = dynamic pm.max_children = 50 pm.start_servers = 20 pm.min_spare_servers = 5 pm.max_spare_servers = 35 pm.max_requests = 500 rlimit_
file
s = 1024 加入 systemtl 服务: cd /usr/local/src/php-7.3.0beta1/sapi/fpm cp php-fpm.service /usr/lib/systemd/system/ 启动: systemctl start php-fpm systemctl status php-fpm -l
Linux/Unix社区
18,830
社区成员
11,502
社区内容
发帖
与我相关
我的任务
Linux/Unix社区
Linux/Unix社区 专题技术讨论区
复制链接
扫一扫
分享
社区描述
Linux/Unix社区 专题技术讨论区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章