Hi -- I have this really simple code:
auto mysql_driver = get_driver_instance();
sql::Connection *c = mysql_driver->connect("172.17.0.1", "root", "tooth");
c->setSchema("mysql");
delete c;
That is generating this error:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted
The following command however works in the terminal:
$ mysql -h 172.17.0.1 -u root -ptooth mysql
If I comment out the line with the call to setSchema() in it, no error is thrown, so it looks like the first attempt to (presumably lazy-) use the connection is causing the error.
I'm on linux, and installed Connector/C++ from the tar file.
Could anybody please advise me on what is going wrong, here? I've been trying to fix this for hours, now, but to no avail.
Thanks in advance for any & all assistance,
Doug.
auto mysql_driver = get_driver_instance();
sql::Connection *c = mysql_driver->connect("172.17.0.1", "root", "tooth");
c->setSchema("mysql");
delete c;
That is generating this error:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted
The following command however works in the terminal:
$ mysql -h 172.17.0.1 -u root -ptooth mysql
If I comment out the line with the call to setSchema() in it, no error is thrown, so it looks like the first attempt to (presumably lazy-) use the connection is causing the error.
I'm on linux, and installed Connector/C++ from the tar file.
Could anybody please advise me on what is going wrong, here? I've been trying to fix this for hours, now, but to no avail.
Thanks in advance for any & all assistance,
Doug.