1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#include <iostream>
#include <stdio.h>
#include <windows.h>
#include <winsock.h>
#include <mysql.h>
#include <MYSQL/mysql.h>
using namespace std;
int main()
{
MYSQL mysql;
if(mysql_init(&mysql)!=NULL){cout<<"ok"<<endl;}
if(mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"option")!=NULL){cout<<"ok2"<<endl;}
if(mysql_real_connect(&mysql,"j'ai mis hote","j'ai mis user de mysql","j'ai mis mon mot de passe","j'ai mis le nom de la bdd",3306,NULL,0)!=NULL){
cout<<"BDD OK"<<endl;
}
else{cout<<"BDD echec"<<endl;}
if(mysql_real_connect(&mysql,"localhost","root","","membres",3306,NULL,0)!=NULL){
cout<<"localhost ok"<<endl;}
else{cout<<"locahost echec"<<endl;}
} |
Partager