MySQL Connector/Python distributions now are available that include a C Extension that interfaces with the MySQL C client library. For queries that return large result sets, using the C Extension can improve performance compared to a “pure Python” implementation of the MySQL client/server protocol.
For binary Connector/Python distributions, some packaging types have a single distribution file that includes the pure-Python Connector/Python code together with the C Extension. (Windows MSI and OS X Disk Image packages fall into this category.) Other packaging types have two related distribution files: One that includes the pure-Python Connector/Python code, and one that includes only the C Extension. For packaging types that have separate distribution files, install both distributions if you want to use the C Extension. The two files have related names, the difference being that the one that contains the C Extension has “cext” in the distribution file name.
Source distributions include both the pure-Python code and the C Extension, and distribution names do not contain “cext”. Instead, availability of the C Extension is determined by whether you compile the distribution with the
Packages for Connector/Python with the C Extension are available at the Connector/Python download site. For installation instructions, see Connector/Python Installation. For information about using the C Extension, see The Connector/Python C Extension.
For Connector/Python installations that support the C Extension, the
use_pureconnection argument to
connect()controls whether to use the extension. If
True(the default), the connection uses pure Python. If
False, the connection uses the C Extension.
It is also possible to use the C Extension directly, by importing the
_mysql_connectormodule rather than the
mysql.connectormodule. See The _mysql_connector C Extension Module.
consume_results, if enabled, causes result sets generated by queries to be automatically consumed and discarded. The
can_consume_resultsconnection object property indicates the value of
mysql.connector.djangoas the engine, the python manage.py inspectdb command failed with an “Unread result found” error. (Bug #20022533)
pool_nameconnection arguments were specified using the option file (as opposed to being passed explicitly to the connect call), the pooled connection was successfully created, but an exception was raised when closing it. (Bug #19549363)
The Django back end raised an exception when converting
None. (Bug #73940, Bug #19667984)
cursor.descriptiondid not compare equal to any of the type objects defined in
mysql.connector.dbapi. (Bug #73798, Bug #19584051)
Data corruption occurred when inserting sufficiently large data in a table with a
TEXTtype column using prepared statements, due to incorrect encoding of the data length while sending the prepared statement packet. (Bug #73690, Bug #19522948)
When the character set was
binary, character set conversion could occur. Conversion is no longer done and
binarydata is returned as is. (Bug #71909, Bug #19500097)