Bart Verstraete wrote:
>
>> 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++?
>
>
I'm not the last word on this, but I'd say it is most likely not a
permission issue as suggested earlier.
So you are asking in the right place. I assume that you pass the exact
same parameters to connect?
I notice you use the connect(...) call. Have you tried something like:
mysqlpp::Connection con (dbname,host),
user, password);
Not that I'd expect it to work any better. It is the preferred way to
connect, per the manual.
Jim.