Я пытаюсь запустить пример C ++ MySQL с веб-сайта mysql.com.
#define DBHOST "tcp://127.0.0.1:3306/"
#define USER "root"
#define PASSWORD ""
//...
string url(DBHOST);
const string user(USER);
const string password(PASSWORD);
const string database(DATABASE);
try {
driver = sql::mysql::get_driver_instance();
/* create a database connection using the Driver */
con = driver->connect(url, user, password);
Я получаю:
First-chance exception at 0x75c99673 in DBTest.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0027f1ec..
First-chance exception at 0x75c99673 in DBTest.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0027eb78..
First-chance exception at 0x75c99673 in DBTest.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
Unhandled exception at 0x75c99673 in DBTest.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0027eb78..
The program '[1236] DBTest.exe: Native' has exited with code -529697949 (0xe06d7363).
… на driver->connect(...)
. Я пытался без присвоения ему con
, то же самое (имеется в виду проблема в get_driver_instance()
)?