# mysql-connector-cpp **Repository Path**: mirrors/mysql-connector-cpp ## Basic Information - **Project Name**: mysql-connector-cpp - **Description**: MySQL Connector/ODBC 是 MySQL 数据库的官方C++驱动程序 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: trunk - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 3 - **Created**: 2019-02-09 - **Last Updated**: 2025-08-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MySQL Connector/C++ This is a release of MySQL Connector/C++, [the C++ interface](https://dev.mysql.com/doc/dev/connector-cpp/8.0/) for communicating with MySQL servers. For detailed information please visit the official [MySQL Connector/C++ documentation](https://dev.mysql.com/doc/dev/connector-cpp/8.0/). ## Licensing Please refer to files README and LICENSE, available in this repository, and [Legal Notices in documentation](https://dev.mysql.com/doc/connector-cpp/8.0/en/preface.html) for further details. ## Download & Install MySQL Connector/C++ can be installed from pre-compiled packages that can be downloaded from the [MySQL downloads page](https://dev.mysql.com/downloads/connector/cpp/). The process of installing of Connector/C++ from a binary distribution is described in [MySQL online manuals](https://dev.mysql.com/doc/connector-cpp/8.0/en/connector-cpp-installation-binary.html) ### Building from sources MySQL Connector/C++ can be installed from the source. Please check [MySQL online manuals](https://dev.mysql.com/doc/connector-cpp/8.0/en/connector-cpp-installation-source.html) ### GitHub Repository This repository contains the MySQL Connector/C++ source code as per latest released version. You should expect to see the same contents here and within the latest released Connector/C++ package. ## Sample Code ``` #include #include using ::std::cout; using ::std::endl; using namespace ::mysqlx; int main(int argc, const char* argv[]) try { const char *url = (argc > 1 ? argv[1] : "mysqlx://root@127.0.0.1"); cout << "Creating session on " << url << " ..." << endl; Session sess(url); cout <<"Session accepted, creating collection..." < ids = add.getGeneratedIds(); for (string id : ids) cout <<"- added doc with id: " << id < 1 and name like 'ba%'").execute(); int i = 0; for (DbDoc doc : docs) { cout <<"doc#" <