Я использую Visual Studio 2022 в Windows 11. Разъем MySQL составляет 9.4.0, установлен из MSI, а MySQL (9.3.0) в докере с Windows 3306 Port. < /p>
. Files \ MySQL \ MySQL Connector C ++ 9.4 \ include \ jdbc;%(AfficeIncludEdirectories)
Дополнительные библиотечные каталоги - C: \ Program Files \ mysql \ mysql connector c ++ 9.4 \ lib64 \ vs14; Connector C ++ 9.4 \ lib64 < /code> < /p>
< /li>
Дополнительные зависимости - mysqlcppconn.lib;%(Дополнительные положения) < /code> < /p>
< /li>
< /ul>
wersh in ho in ho in the ant in ho in the in worm in ho in the ant in the ant in the ant in the ant wor in the ant wor in the ant wor in the ante in the ant a work in the antemed -speed -sharbbe in my worm. работающий пользователь и пройти. Перенесите их во все папки отладки, которые я мог найти в своем каталоге проекта, в том числе с моим файлом .exe < /code>. < /p>
my code: < /p>
#include
#include
#include
#include
#include
int main() {
try {
sql::Driver* driver = get_driver_instance();
std::unique_ptr con(
driver->connect("tcp://127.0.0.1:3306", "jayanth", "Jayanth1234")
);
con->setSchema("test");
std::unique_ptr stmt(con->createStatement());
// Create table if not exists
stmt->execute("CREATE TABLE IF NOT EXISTS demo (id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(20))");
// Insert a row
stmt->execute("INSERT INTO demo (name) VALUES ('SampleName')");
std::cout
Подробнее здесь: https://stackoverflow.com/questions/797 ... ocess-6320