Connectors and APIs
Database Connectors provide connectivity to the TiDB server for client programs. APIs provide low-level access to the MySQL protocol and MySQL resources. Both Connectors and the APIs enable you to connect and execute MySQL statements from another language or environment, including ODBC, Java (JDBC), Perl, Python, PHP, Ruby and C.
TiDB is compatible with all Connectors and APIs of MySQL (5.6, 5.7), including:
- MySQL Connector/C++
- MySQL Connector/J
- MySQL Connector/Net
- MySQL Connector/ODBC
- MySQL Connector/Python
- MySQL C API
- MySQL PHP API
- MySQL Perl API
- MySQL Python API
- MySQL Ruby APIs
- MySQL Tcl API
- MySQL Eiffel Wrapper
- Mysql Go API
Connect to TiDB using MySQL Connectors
Oracle develops the following APIs and TiDB is compatible with all of them:
- MySQL Connector/C++:to enable C++ applications to connect to MySQL
- MySQL Connector/J:to enable Java applications to connect to MySQL using the standard JDBC API
- MySQL Connector/Net:to enable .Net applications to connect to MySQL; MySQL for Visual Studio uses this; support Microsoft Visual Studio 2012, 2013, 2015 and 2017 versions
- MySQL Connector/ODBC:the standard ODBC API; support Windows, Unix, and OS X platforms
- MySQL Connector/Python:to enable Python applications to connect to MySQL, compliant with the Python DB API version 2.0
Connect to TiDB using MySQL C API
If you use C language programs to connect to TiDB, you can connect to libmysqlclient directly and use the MySQL C API. This is one of the major connection methods using C language, widely used by various clients and APIs, including Connector/C.
Connect to TiDB using third-party MySQL APIs
The third-party APIs are not developed by Oracle. The following table lists the commonly used third-party APIs: