MySQL Connector/Python Developer Guide

Chapter 11 Connector/Python C Extension API Reference

This chapter contains the public API reference for the Connector/Python C Extension, also known as the _mysql_connector Python module.

The _mysql_connector C Extension module can be used directly without any other code of Connector/Python. One reason to use this module directly is for performance reasons.


Examples in this reference use ccnx to represent a connector object as used with the _mysql_connector C Extension module. ccnx is an instance of the _mysql_connector.MySQL() class. It is distinct from the cnx object used in examples for the mysql.connector Connector/Python module described in Chapter 10, Connector/Python API Reference. cnx is an instance of the object returned by the connect() method of the MySQLConnection class.


The C Extension is not part of the pure Python installation. It is an optional module that must be installed using a binary distribution of Connector/Python that includes it, or compiled using a source distribution. See Chapter 4, Connector/Python Installation.