I am writing a simple program to connect to a MySQL Server hosted locally. I have ensured the server is running. The code I am trying to execute is the following:
void CSlaveController::fnDatabaseConnection(){
sql::Driver *driver;
sql::Connection *connection;
sql::ResultSet *result;
sql::Statement *statement;
sql::PreparedStatement *prepared;
driver = get_driver_instance();
connection = driver->connect("tcp://127.0.0.1:3306","DBServer","root"); /*Where the program crashes*/
statement = connection->createStatement();
statement->execute("SHOW DATABASES");
delete statement;
delete connection;
}
One of the issues I have noticed is that the header file mysql_connection.h is not found when I run the program. When I build the project, no issue is raised. But when I run the program, it crashes and this is what I see: . I have double checked the includes and even manually added that specific file.
关于我可能做错了什么有什么想法吗?如果图像太多,我很抱歉,我觉得这将是传达最多信息的最佳方式。
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)