17 messages in com.mysql.lists.plusplusRe: mysql++ 3.0 beta2 Connecting trou...| From | Sent On | Attachments |
|---|---|---|
| Bart Verstraete | 06 Jan 2008 06:33 | |
| Jonathan Wakely | 06 Jan 2008 06:54 | |
| Bart Verstraete | 07 Jan 2008 02:57 | |
| Warren Young | 07 Jan 2008 05:55 | |
| Jim | 07 Jan 2008 05:59 | |
| Bart Verstraete | 08 Jan 2008 04:29 | |
| Bart Verstraete | 08 Jan 2008 06:29 | |
| Warren Young | 08 Jan 2008 11:49 | |
| Bart Verstraete | 08 Jan 2008 12:39 | |
| Warren Young | 08 Jan 2008 12:56 | |
| Jim | 09 Jan 2008 09:01 | |
| Bart Verstraete | 10 Jan 2008 00:05 | |
| Bart Verstraete | 10 Jan 2008 00:20 | |
| Bart Verstraete | 10 Jan 2008 00:46 | |
| Bart Verstraete | 10 Jan 2008 01:20 | |
| Warren Young | 10 Jan 2008 16:14 | |
| Warren Young | 10 Jan 2008 16:19 |
| Subject: | Re: mysql++ 3.0 beta2 Connecting troubles![]() |
|---|---|
| From: | Jim (ji...@fayettedigital.com) |
| Date: | 01/07/2008 05:59:09 AM |
| List: | com.mysql.lists.plusplus |
Bart Verstraete wrote:
Jonathan Wakely schreef:
On 06/01/2008, Bart Verstraete <bart...@telenet.be> wrote:
Why wont this work?
m_connected = connect("TEST", "127.0.0.1", "user", "pw", 3307);
It compiles without an error but while connecting it trows a exception "Access denied ....blablabla". The db is tunneled via ssh on port 3307
It's almost certainly nothing to do with mysql++ - try connecting to the same DB through the same ssh tunnel using the `mysql' command line client and see if that works. If that fails as well then obviously the reason mysql++ fails to connect is that you don't have permission to access the DB using that setup.
Jon
Thats the problem, I can connect to the remote db thought the tunnel with 'mysql', 'mysql-admin', 'mysql-query-browser', etc. But not with mysql++3.0 the only thing it says 'Access denied no permission' or something but with te same user and pw I can connect with 'mysql' and others. Pls help.
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.




