#pragma comment(lib, "libmysql.lib");
#define SERVER "localhost" //works only with 127.0.0.1
#define USER "root"
#define PASSWORD ""
#define DATABASE "userx"
MYSQL *connect; // Create a pointer to the MySQL instance
connect=mysql_init(NULL); // Initialise the instance
if(!connect) /* If instance didn't initialize say so and exit with fault.*/
fprintf(stderr,"MySQL Initialization Failed");
hey guys im trying to connect to a local database using the code above, it doesn't work thou when i use 'localhost', it works only when i used '127.0.0.1' instead of 'localhost'
so when i'm trying to connect now on my database online, it wont work ...my host name is something like hostname.xxxxx.com, so i tried to use the ip of my host which is 192.168.0.xxx but still doesn't work. I don't know what's wrong with this, im using ...MySQL Connector C 6.0.2