- 我需要外部库吗?
- 有没有什么极简的例子?
最佳答案
最简单的方法是使用通常与 MySQL 服务器一起安装的 C API。例如,在 Windows 上,它位于“C:\Program Files\MySQL\MySQL Server 5.0”(参见“include”和“lib”目录)。
If you are looking for examples that demonstrate how to use the C API, take a look at these clients. You can find these in the client directory in the MySQL source distribution.
客户端API叫做mysqlclient
,你可以找到文档here .
但您也可以使用其他库,例如 C++ wrapper on sourceforge .或包含在跨平台工具包中的 ODBC 抽象(例如 wxWidgets 中的 wxDb)。
关于c++ - 使用 C++ 将数据插入 mysql 数据库的最简单方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2371560/