Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionprocedure TForm1.Button1Click(Sender: TObject); Var user,host,pwd:string; portip:integer; begin user:='root'; pwd:='pass'; host:='127.0.0.1'; portip:=3306; MySQL := mysql_init(nil); mysql_options(mysql,MYSQL_OPT_COMPRESS,0); if mysql_real_connect(mysql, pChar(host), pChar(user), pChar(pwd), nil, portip, nil, 0)=nil then label1.caption:='La connexion a echouee' else label1.caption:='connexion OK'; end;
procedure TForm1.Button2Click(Sender: TObject); begin if mysql_create_db(mysql, pChar(dbname))<>0 then label2.caption:='La creation a echouée' else label2.caption:='Creation OK'; end;