C++ to MySQL remote DB

I am new to C++, and if I wanted to create a C++ program on my Windows machine, and integrate it with a MySQL remote DB, how would I do that?

Meaning, I have a Hostgator account that I created a MySQL DB, so I have the Ip/User/Pass.

I want to create a very simple form on my local machine, that asks for Name, Email, and Phone, but have it write over to the remote MySQL DB.

If anyone can point me in the right direction, it would be greatly appreciated. Thank you in advance
I wanted to create a C++ program on my Windows machine, and integrate it with a MySQL remote DB

C++ does not support this "out-of-the-box". You need to integrate a special library (the "connector") for connecting to the database server, sending queries to the database, retrieving the results and so on.

In case of MySQL, you probably want to use the MySQL Connector/C++ library from Oracle.

Download:
https://dev.mysql.com/downloads/connector/cpp/

API documentation:
https://dev.mysql.com/doc/dev/connector-cpp/8.0/


Here is a full example on how using the MySQL Connector looks in C++ code:
https://dev.mysql.com/doc/connector-cpp/1.1/en/connector-cpp-examples-complete-example-1.html


BTW: If you are new to C++, maybe first learn how to use 3rd-party libraries in your project!

(Some profound understanding of SQL will also be required, of course. After all, the purpose of the connector library is to send SQL commands to the MySQL server. You still need to write those SQL commands!)
Last edited on
Topic archived. No new replies allowed.