List:MySQL++« Previous MessageNext Message »
From:Bart Verstraete Date:January 8 2008 2:29pm
Subject:Re: mysql++ 3.0 beta2 Connecting troubles
View as plain text  
> Try running a program using the mysql api.  If it works OK then it may 
> be a mysql++ problem but if you can't get a program using the mysql 
> api working, it isn't mysql++.
>
> This should get you started:
>
> Testm.cpp
> #include <mysql/mysql.h>
> #include <string>
> #include <iostream>
> #define AMYSQL_PORT 3307
>
> using namespace std;
>
> int main(int argc, char **argv)
> {
>
>    static MYSQL *conptr, *tptr;
>    string host="";
>    string uname="";
>    string upass="";
>    string db="";
>    conptr = mysql_init (conptr);
>    tptr = mysql_real_connect (
>               conptr, host.c_str(), uname.c_str(), upass.c_str(), 
> db.c_str(), AMYSQL_PORT, NULL, 0);
>    if(tptr == NULL) {
>        cout <<"Failed to connect"<<endl;
>    }
> }
>
> Of course, fill in the empty strings with something that will work.
>
> Jim.
>
I tried it, it connects fine so its mysql++?


Thread
mysql++ 3.0 beta2 Connecting troublesBart Verstraete6 Jan
  • Re: mysql++ 3.0 beta2 Connecting troublesJonathan Wakely6 Jan
    • Re: mysql++ 3.0 beta2 Connecting troublesBart Verstraete7 Jan
      • Re: mysql++ 3.0 beta2 Connecting troublesJim7 Jan
        • Re: mysql++ 3.0 beta2 Connecting troublesBart Verstraete8 Jan
          • Re: mysql++ 3.0 beta2 Connecting troublesJim9 Jan
            • Re: mysql++ 3.0 beta2 Connecting troublesBart Verstraete10 Jan
              • Re: mysql++ 3.0 beta2 Connecting troublesBart Verstraete10 Jan
                • Re: mysql++ 3.0 beta2 Connecting troublesBart Verstraete10 Jan
                  • Re: mysql++ 3.0 beta2 Connecting troublesWarren Young11 Jan
  • Re: mysql++ 3.0 beta2 Connecting troublesWarren Young7 Jan
    • Re: mysql++ 3.0 beta2 Connecting troublesBart Verstraete8 Jan
      • Re: mysql++ 3.0 beta2 Connecting troublesWarren Young8 Jan
        • Re: mysql++ 3.0 beta2 Connecting troublesBart Verstraete8 Jan
          • Re: mysql++ 3.0 beta2 Connecting troublesWarren Young8 Jan
            • Re: mysql++ 3.0 beta2 Connecting troublesBart Verstraete10 Jan
              • Re: mysql++ 3.0 beta2 Connecting troublesWarren Young11 Jan