mysql Ver 11.16 Distrib 3.23.49, for redhat-linux-gnu (i386)
void CFosdb::DBConnect(const char *host,const char *user, const char* passwd, const char* db)
{
if((mysql = (MYSQL*)malloc(sizeof(MYSQL))) != NULL)
{
if(mysql_real_connect(mysql,host,user,passwd,db,0,NULL,0) == NULL)
{
free(mysql);
exit(1);
}
}
printf("connect 후..\n");
}이런식으로 했습니다.