(一)code
#include <stdio.h>
#include <stdlib.h>}
(二)Makefile
[lvhongmin@AY1401201736089361adZ database]$ cat Makefile
FLAGS = -O2 -g -Wpointer-arith -Wstrict-prototypes -lm -W -Wall
LIB = -lpthread -lmysqlclient
INCLUDE_PATH = /usr/include/mysql
CC = gcc
all:lhm.exe
lhm.exe:lhm_query.c
$(CC) -o $@ ${LIB} ${FLAGS} -L /usr/lib64/mysql -I ${INCLUDE_PATH} lhm_query.c
clean:
rm lhm.exe
linux下操作mysql,支持重连,布布扣,bubuko.com
原文地址:http://blog.csdn.net/wusthongmin/article/details/36626697