Documentation Home
MySQL Connector/C++ Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 266.3Kb
PDF (A4) - 267.8Kb
HTML Download (TGZ) - 55.1Kb
HTML Download (Zip) - 69.6Kb


MySQL Connector/C++ Developer Guide  /  Introduction to Connector/C++

Chapter 1 Introduction to Connector/C++

MySQL Connector/C++ is a MySQL database connector for C++ applications that connect to the MySQL Server:

  • Connector/C++ 8.0 can be used to access MySQL servers that implement a document store, or in a traditional way using SQL queries. It enables development of C++ applications using X DevAPI, or plain C applications using XAPI. It also enables development of C++ applications that use the legacy JDBC-based API from Connector/C++ 1.1.

    Connector/C++ 8.0 applications that use X DevAPI or XAPI require a MySQL server that has X Plugin enabled. For Connector/C++ 8.0 applications that use the legacy JDBC-based API, X Plugin is not required or supported.

  • Connector/C++ 1.1 enables development of C++ applications that use the JDBC-based API. For applications that use Connector/C++ 1.1, X DevAPI, XAPI, and X Plugin are not required or supported.

For more detailed requirements about required MySQL versions for Connector/C++ and Connector/C++ applications, see Platform Support and Prerequisites.

For notes detailing the changes in each release of Connector/C++, see MySQL Connector/C++ Release Notes.

Connector/C++ Benefits

MySQL Connector/C++ offers the following benefits for C++ users compared to the MySQL C API provided by the MySQL client library:

  • Convenience of pure C++; no C function calls required.

  • Supports these application programming interfaces:

    • X DevAPI (Connector/C++ 8.0)

    • XAPI (Connector/C++ 8.0)

    • JDBC 4.0-based API (Connector/C++ 8.0 or 1.1)

  • Supports the object-oriented programming paradigm.

  • Reduces development time.

  • Licensed under the GPL with the FLOSS License Exception.

  • Available under a commercial license upon request.

Connector/C++ and X DevAPI

Connector/C++ 8.0 implements X DevAPI, as described in X DevAPI User Guide. X DevAPI enables connecting to MySQL servers that implement a document store with X Plugin. X DevAPI also enables applications to execute plain SQL queries.

Connector/C++ and XAPI

Connector/C++ 8.0 implements a plain C interface called XAPI that offers functionality similar to that of X DevAPI and that can be used by applications written in plain C. XAPI enables connecting to MySQL servers that implement a document store with X Plugin. XAPI also enables applications to execute plain SQL queries.

Connector/C++ and JDBC Compatibility

Connector/C++ 1.1 is compatible with the JDBC 4.0 API. Connector/C++ 1.1 does not implement the entire JDBC 4.0 API, but does feature these classes: Connection, DatabaseMetaData, Driver, PreparedStatement, ResultSet, ResultSetMetaData, Savepoint, Statement.

The JDBC 4.0 API defines approximately 450 methods for the classes just mentioned. Connector/C++ 1.1 implements approximately 80% of these.

Connector/C++ 8.0 also implements the JDBC 4.0 API, if built to include the legacy JDBC connector:

Platform Support and Prerequisites

To see which platforms are supported, visit the Connector/C++ downloads page.

These requirements apply to building and running Connector/C++ applications, and to building Connector/C++ itself if you build it from source:

  • To build Connector/C++ applications:

    • The MySQL version does not apply.

    • On Windows, Microsoft Visual Studio 2015 is required.

  • To run Connector/C++ applications, the MySQL Server requirements depend on the API the application uses:

    • Applications that use the JDBC API can use MySQL Server 5.5 or higher. This includes Connector/C++ 1.1 applications (which always use the JDBC API) and Connector/C++ 8.0 applications that use the JDBC API.

    • Connector/C++ 8.0 applications that use X DevAPI or XAPI require MySQL Server 5.7 (5.7.12 or higher) or MySQL Server 8.0 (8.0.11 or higher), with X Plugin enabled. For MySQL 8.0, X Plugin is enabled by default. For MySQL 5.7, it must be enabled explicitly.

    In addition, applications that use certain recent MySQL features may require MySQL Server 8.0.

  • To build Connector/C++ from source, the MySQL C API client library may be required:

    • Building the JDBC connector requires the client library from MySQL 5.7 (5.7.9 or higher) or MySQL 8.0 (8.0.11 or higher). This includes building Connector/C++ 1.1 (which always includes the JDBC connector), and Connector/C++ 8.0 built with the WITH_JDBC option enabled to include the JDBC connector.

    • For Connector/C++ 8.0 built without the JDBC connector, the MySQL version does not matter because the client library is not needed.

    On Windows, Microsoft Visual Studio 2015 is required.

For Connector/C++ 1.1.11 and higher, Commercial and Community distributions require the Visual C++ Redistributable for Visual Studio 2015 to work on Windows platforms. Up through Connector/C++ 1.1.10, Community (not Commercial) distributions require the Visual C++ Redistributable for Visual Studio 2013. The Redistributable is available at the Microsoft Download Center; install it before installing Connector/C++.


User Comments
Sign Up Login You must be logged in to post a comment.