C++ Program communicating with MySQL Database

前端 未结 8 1459
醉梦人生
醉梦人生 2021-01-03 10:01

Does anyone know of a simple way for a C++ program to communicate directly with a MySQL database? I have looked at MySQL++ and found it to be very confusing. If anyone kno

相关标签:
8条回答
  • 2021-01-03 10:40

    Use the C API:

    http://dev.mysql.com/doc/refman/5.0/en/c.html

    0 讨论(0)
  • 2021-01-03 10:40

    I have used MySQL++ with great success. I found it to be everything I was looking for in a MysQL database client library. The examples they provide are great, see here for a simple one.

    If you know C++, it is much easier to use than the C library. It works great with Windows.

    0 讨论(0)
  • 2021-01-03 10:41

    Use SQLAPI++ - it does SQL Server and more.

    http://www.sqlapi.com/

    0 讨论(0)
  • 2021-01-03 10:42

    MySQL Connector/C++ is a C++ implementation of JDBC 4.0

    The reference customers who use MySQL Connector/C++ are: - OpenOffice - MySQL Workbench

    Learn more: http://forums.mysql.com/read.php?167,221298

    0 讨论(0)
  • 2021-01-03 10:47

    Are you sure that the C++ program needs to interact directly with the MySQL database?

    I would suggest having the C++ program communicate with the web server using simple http requests, and let PHP handle the database. Data can be passed to a server-side PHP script via arguments, and data can be returned in XML format.

    Writing: your.server.com/add_data.php?table="info"&data="0xFCBD..."

    Reading: your.server.com/get_data.php?table="info"

    0 讨论(0)
  • 2021-01-03 10:51

    MySQL has a beta release of MySQL Connector C++ that can be found Here. It's a connector written in C++ but modeled after Java's JDBC connectors. If you've used JDBC at all, this will feel almost identical. It's also cross platform and can be compiled on Linux, Windows, and Mac OS.

    0 讨论(0)
提交回复
热议问题