Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mysql/mysql-connector-cpp
MySQL Connector/C++ is a MySQL database connector for C++. It lets you develop C++ and C applications that connect to MySQL Server.
https://github.com/mysql/mysql-connector-cpp
Last synced: 1 day ago
JSON representation
MySQL Connector/C++ is a MySQL database connector for C++. It lets you develop C++ and C applications that connect to MySQL Server.
- Host: GitHub
- URL: https://github.com/mysql/mysql-connector-cpp
- Owner: mysql
- License: other
- Created: 2016-01-22T09:59:10.000Z (almost 9 years ago)
- Default Branch: trunk
- Last Pushed: 2024-10-15T07:54:29.000Z (3 months ago)
- Last Synced: 2025-01-03T05:06:44.675Z (9 days ago)
- Language: C++
- Homepage:
- Size: 20.5 MB
- Stars: 640
- Watchers: 46
- Forks: 247
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-mysql - MySQL Connector/C++ - Official C/C++ driver for MySQL. (Connectors)
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
#includeusing ::std::cout;
using ::std::endl;
using namespace ::mysqlx;int main(int argc, const char* argv[])
try {const char *url = (argc > 1 ? argv[1] : "mysqlx://[email protected]");
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#" <