![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I am having a strange problem with connecting and I can't find any information which indicates I am doing anything wrong. I have this sample code: int main(int argc, char* argv[]) { cout << "Hello!" << endl; try { Connection connect("blog","10.0.0.1", "test_user",""); string querystr = "select * from test"; Query query = connect.query(); query << querystr; Result res = query.store(); Row row; Result::iterator iter; for (iter = res.begin(); iter != res.end(); iter++) { row = *iter; cout << (const char*)row[(unsigned int)0] << endl; } } catch (mysqlpp::Exception x) { cerr << "MySQL Generated an error: " x.what() << endl; return -1; } return 0; } If I use a username that has a password, I always generate this error: MySQL Generated an error: Access denied for user: 'with_pass@my_server' (Using password: YES) however, changing the user to one with no password (and providing an empty string for the password) works correctly Can someone please point me in the right direction, or explain what I am missing or doing wrong. |
![]() |
| Thread Tools | |
| Display Modes | |
| |