摘要:
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 阅读全文
摘要:
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 阅读全文