The driver crash when calling driver->connect
Hi, I want to connect to a database using the cpp connector but the program crash when I'm trying to connect to the database :
sql::Driver* driver = get_driver_instance();
std::cout<<driver->getMajorVersion()<<","<<driver->getMinorVersion()<<std::endl<<"name : "<<driver->getName()<<std::endl;
if (driver == nullptr)
std::cout<<"failed to get driver"<<std::endl;
sql::Connection* con = driver->connect("tcp://127.0.0.1:3306", "root",password);
if (con == nullptr)
std::cout<<"failed to connect to database"<<std::endl;
con->setSchema("sorrok");
And the returning version is strange, version major is 0, version minor is 22 and name is empty.
And when I use sql::mysql::MySQL_Driver = sql::mysql::get_mysql_driver_instance I get an undefined reference error to sql::mysql::get_driver_instance.
Subject
Views
Written By
Posted
The driver crash when calling driver->connect
1391
November 27, 2020 03:06PM
618
November 27, 2020 05:05PM
814
November 28, 2020 07:56AM
598
November 30, 2020 03:52AM
501
December 01, 2020 11:19AM
513
December 01, 2020 11:21AM
641
December 13, 2020 11:59AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.