Home >Database >Mysql Tutorial >数据库连接池libzdb.2.12在Centos 6.5 64位下的安装

数据库连接池libzdb.2.12在Centos 6.5 64位下的安装

WBOY
WBOYOriginal
2016-06-07 15:26:482371browse

数据库连接池libzdb.2.12在Centos 6.5 64位下的安装 1.源代码下载地址:https://github.com/tildeslash/libzdb/releases 下载后解压 需要安装一些依赖包 Gcc 是必须要有的 mysql 开发包 yum install Mysql-devel yum install flex ./configure 会报错,估计不


    
    数据库连接池libzdb.2.12在Centos 6.5 64位下的安装

1.源代码下载地址:https://github.com/tildeslash/libzdb/releases
下载后解压
需要安装一些依赖包
Gcc 是必须要有的

mysql 开发包
yum install Mysql-devel
yum install flex

./configure

会报错,估计不同的系统会报不同的错误,直接修改configure文件


这一段屏蔽掉
# if  ac_fn_c_try_run "$LINENO"; then :

# else
#   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
#  $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
#  as_fn_error $? "setjmp is  required
#  See \`config.log' for more details" "$LINENO" 5; }

# fi

这段也屏蔽
# if ac_fn_c_try_run "$LINENO"; then :

# else
#  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
# $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
# as_fn_error $? "vsnprintf does not conform to c99
# See \`config.log' for more details" "$LINENO" 5; }

# fi  

这样./configure 就通过了
make
make install


mysql 客户端动态库要拷到系统目录下,不然测试程序select.c 编译后报错

/usr/local/mysql/lib/libmysqlclient.so.18 拷贝到 /usr/lib64

修改select.c
mysql 连接 url
URL_T url = URL_new("mysql://localhost/hddata1?user=root&password=&charset=utf8");
其中charset指定字符集,不指定的mysql中中文会乱码

mysql 数据库字符集用GB2312

例子 select.c 编译

gcc -std=c99  -o select select.c -L/usr/local/lib -lzdb -I/usr/local/include/zdb




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:oracle number 类型Next article:【Cocos2dX(2.x)