我想运行连接到 mariaDB 的 C 程序,为此我安装了 mariaDB 版本:
Server: MariaDB
Server version: 10.1.11-MariaDB MariaDB Server
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
但是我是通过一篇文章来的
因此,我没有安装 C 连接器(由于 mysql-mariaDB 的相似性质)并尝试从此链接中的示例程序 http://zetcode.com/db/mysqlc/ .
但是它说:
[root@localhost Desktop]# gcc version.c -o version `mysql_config --cflags --libs`
bash: mysql_config: command not found...
version.c:1:23: fatal error: my_global.h: No such file or directory
#include <my_global.h>
^
compilation terminated.
然后我尝试安装 libmysqlclient-dev/libmariaclient-dev
& 它说没有包 libmysqlclient-dev/libmariaclient-dev
可用。
现在我该怎么办?
最佳答案
你需要找出哪个包为你提供了mysql_config。根据我的检查,您可以通过 yum whatprovides mysql_config
来完成。如果是 Arch,我得到:
[root@main]# pkgfile mysql_config
extra/libmariadbclient
关于mysql - 无法在 CentOS 上使用 MariaDB 编译 C 程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35531782/