visual studio 2019 c++ mysql connector8.0
https://github.com/clucle/cpp_mysql_vs2019
clucle/cpp_mysql_vs2019
mysql-connector with visualstudio. Contribute to clucle/cpp_mysql_vs2019 development by creating an account on GitHub.
github.com
1. Download MySQL & make database
download MySQL
https://dev.mysql.com/downloads/installer/
After installation, Open Workbench. Connect Mysql.
2. Download MySQL Connector8.0
download MySQL Connector cpp (current version 8.0 2020.01.20)
https://dev.mysql.com/downloads/connector/cpp/
Download zip file. Decompression zip file.
3. Download Boost & Install
(current version 1.72)
https://www.boost.org/doc/libs/1_72_0/more/getting_started/windows.html
You need to install as well as download (stage folder build by b2)
4. Set Environment variables
Set BOOST_ROOT & MYSQL_ROOT
5. Visual Studio Settings
6. Copy Dll File
Copy & Paste 4 files.
7. Run Code
#include <stdlib.h>
#include <iostream>
#include <jdbc/cppconn/driver.h>
#include <jdbc/cppconn/exception.h>
#include <jdbc/cppconn/resultset.h>
#include <jdbc/cppconn/statement.h>
using namespace std;
int main(void)
{
sql::Driver* driver;
sql::Connection* con;
driver = get_driver_instance();
con = driver->connect("tcp://127.0.0.1:3306", "your_id", "your_password");
con->setSchema("sampledatabase");
delete con;
cout << endl;
return EXIT_SUCCESS;
}