if(mysql_init(&mysql)==NULL) {
printf("Failed to initate MySQL connection\n");
exit(1);
}
/*Connecting to MySQL server*/
if (!mysql_real_connect(&mysql,"localhost","root","mysql","db1",0,NULL,0)) {
printf( "Failed connect to the server: %s\n",
mysql_error(&mysql));
exit(1);
}