摘要: 1. 代码编写#include<stdlib.h>#include<stdio.h>#include"mysql.h"intmain(intargc,char*argv[]){MYSQLmy_connection;intres;mysql_init(&my_connection);if(mysql_real_connect(&my_connection,"localhost","root","mysql","mysql",0,NULL,0)){printf 阅读全文
posted @ 2012-05-25 15:58 Master HaKu 阅读(3979) 评论(0) 推荐(0) 编辑
摘要: 1. 安装mysql client包 sudo apt-get install libmysqlclient15-dev2. 编写C程序#include<stdlib.h>#include<stdio.h>#include"mysql.h"intmain(intargc,char*argv[]){MYSQL*conn_ptr;conn_ptr=mysql_init(NULL);if(!conn_ptr){fprintf(stderr,"mysql_initfailed\n");returnEXIT_FAILURE;}conn_pt 阅读全文
posted @ 2012-05-25 15:33 Master HaKu 阅读(374) 评论(0) 推荐(0) 编辑