Domanda

I have a database, I can see it with phpMyAdmin. But when I try to connect in my C program it fail and mysql_error only return :

Unknown database 'database-name'

There is no spelling mistake so why doesn't it work ?

EDIT : here is the code used :

if(mysql_real_connect(&mysql, address, username, password, database, 0, NULL, 0) == NULL) {
    printf("%s\n", mysql_error(&mysql));
    exit(1);
}

address, username, password and database are char * with the correct values and it's not an issue with user's rights.

È stato utile?

Soluzione

I tried it on my own MySQL version, it worked, after re-installing MySQL on the destination computer it worked. Sorry for the disturbance.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top