源程序:
#include
#include
#include
int main(int argc, char ** argv[])
{
MYSQL mysql;
MYSQL_RES *result;
MYSQL_ROW row;
int err;
mysql_init(&mysql);
if(!mysql_real_connect(&mysql, "localhost", "root", NULL, "backup", 0, 0, 0 )) printf("error\n");;
mysql_query(&mysql, "insert into test values(3)");
}
编译参数:
CFG=/export/home/mysql/product/bin/mysql_config
sh -c "cc -o test `$CFG --cflags` test.c `$CFG --libs`"
阅读(697) | 评论(0) | 转发(0) |