NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #883 most downloaded on PyPI
Python interface to MySQL
Last release 20 days ago
14 Sep 2026
Release timing varies
gaps range from 3 weeks to 13 months
Nearly every release is documented
notes for 37 of 39 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
45 releases · first in 2014
deprecate exception classes in Cursor attributes by @methane in #782
Cursor.warning_count by @methane with @Copilot in #780Full Changelog: v2.2.8...v2.3.0
One column per quarter.
Release: 2026-09-07
Concurrent use of the same Connection object from multiple threads now raises ProgrammingError immediately instead of causing undefined behavior. Applications should use separate connections for concurrent operations. (#781)
Add an optional executemany_fallback="multi" connection option. When enabled, Cursor.executemany() can batch eligible INSERT, REPLACE, UPDATE, and DELETE statements into multi-statement queries instead of executing them one at a time. This can significantly improve performance of operations such as SQLAlchemy bulk UPDATEs. The default remains "loop", and the existing multi-row INSERT/REPLACE optimization is unchanged. (#798)
Add Cursor.warning_count to expose the warning count for the last statement. (#780)
Make Cursor itself an iterator as specified by DB-API 2.0. iter(cursor) is cursor and next(cursor) fetches the next row. (#785)
Quote stored procedure names and user variable names in Cursor.callproc(), allowing names containing reserved words or special characters. (#789)
Fix conversion of datetime.timedelta values to support microseconds and negative values correctly. (#795)
Add Windows ARM64 wheels. (#796)
Test with Python 3.15 and free-threaded Python 3.15, and update the MariaDB Connector/C used for Windows wheels to 3.4.9. (#797)
Add Connection.more_results() for checking whether additional results remain after a multi-statement query. (#798)
Deprecate accessing exception classes such as ProgrammingError and OperationalError as Cursor attributes. Access them from the MySQLdb package instead. (#782)
Deprecate the reconnect parameter of Connection.ping(). Calling ping() without the parameter is unchanged. (#790)
support local_infile_dir option by @RasmusKard in #755
Full Changelog: v2.2.7...v2.2.8
Release: 2026-02-10
Add local_infile_dir option to restrict LOAD DATA LOCAL INFILE file path. (#755)
windows wheel: Update mariadb-connector to 3.4.8 (#773)
Add Python 3.14 and drop Python 3.8, 3.9 support. (#774)
Experimental support for free threaded Python. Importing MySQLdb doesn't enable the GIL anymore. This doesn't mean mysqlclient is thread safe. You must not use same connection object from multiple threads concurrently. (#775)
MariaDB include paths for Win by @CristiFati in #749
Full Changelog: v2.2.6...v2.2.7
Release: 2025-01-10
Add user, host, database, and db attributes to Connection. opentelemetry-instrumentation-(dbapi|mysqlclient) use them. (#753)
MariaDB Connector/C 3.4 and MairaDB 11.4 had enabled SSL and CA verification by default. It affected 2.2.5 windows wheels. This release disables SSL a
MariaDB Connector/C 3.4 and MairaDB 11.4 had enabled SSL and CA verification by default.
It affected 2.2.5 windows wheels. This release disables SSL and CA verification by default for backward compatibility. (#731)
Add server_public_key_path option. It is needed to connect MySQL server with
sha256_password or caching_sha2_password authentication plugin without
secure connection. (#744)
Full Changelog: v2.2.5...v2.2.6
Release: 2024-11-12
MariaDB Connector/C 3.4 and MairaDB 11.4 enabled SSL and CA verification by default. It affected 2.2.5 windows wheel. This release disables SSL and CA verification by default. (#731)
Add server_public_key_path option. It is needed to connect MySQL server with sha256_password or caching_sha2_password authentication plugin without secure connection. (#744)
Support building against Percona Server builds of MySQL client library libperconaserverclient by @nattofriends in #718
libperconaserverclient by @nattofriends in #718Full Changelog: v2.2.4...v2.2.5
Release: 2024-10-20
(Windows wheel) Update MariaDB Connector/C to 3.4.1. #726
(Windows wheel) Build wheels for Python 3.13. #726
Support ssl=True by @methane in #700
Full Changelog: v2.2.3...v2.2.4
Release: 2024-02-09
Support ssl=True in connect(). (#700) This makes better compatibility with PyMySQL and mysqlclient==2.2.1 with libmariadb. See #698 for detail.
fix Connection.kill() broken since 2.2.2 by @methane in #696
Full Changelog: v2.2.2...v2.2.3
Release: 2024-02-04
Fix Connection.kill() method that broken in 2.2.2. (#689)
conn.kill() and conn.shutdown() are deprecated.
Release: 2024-02-04
Support building with MySQL 8.3 (#688).
Deprecate db.shutdown() and db.kill() methods in docstring. This is because mysql_shutdown() and mysql_kill() were removed in MySQL 8.3. They will emit DeprecationWarning in the future but not for now.
Connection.ping() avoid using MYSQL_OPT_RECONNECT option until reconnect=True is specified. MySQL 8.0.33 start showing warning when the option is used
Connection.ping() avoid using MYSQL_OPT_RECONNECT option until reconnect=True is specified. MySQL 8.0.33 start showing warning when the option is used. (#664)pkg-config to documentation by @hamarituc in #621README.md by @Benjamin-Loison in #665Full Changelog: v2.2.0...v2.2.1
mysqlclient uses pkg-config since v2.2. You need to configure pkg-config, or manually set envvars. READ the manual
mysqlclient uses pkg-config since v2.2. You need to configure pkg-config, or manually set envvars.
READ the manual
Full Changelog: v2.1.1...v2.2.0
Release: 2023-06-22
Use pkg-config instead of mysql_config (#586)
Raise ProgrammingError on -inf (#557)
Raise IntegrityError for ER_BAD_NULL. (#579)
Windows: Use MariaDB Connector/C 3.3.4 (#585)
Use pkg-config instead of mysql_config (#586)
Add collation option (#564)
Drop Python 3.7 support (#593)
Use pyproject.toml for build (#598)
Add Cursor.mogrify (#477)
Partial support of ssl_mode option with mariadbclient (#475)
Discard remaining results without creating Python objects (#601)
Fix executemany with binary prefix (#605)
v2.2.0 uses pkg-config instead of mysql_config . You need to install pkg-config to build. You can configure cflags and ldflags manually by setting MYS
v2.2.0 uses pkg-config instead of mysql_config. You need to install pkg-config to build. You can configure cflags and ldflags manually by setting MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS too.
Cursor.mogrify() is added.
Cursor.executemany implementation now uses mogrify(). Sequencee of scalar value (e.g. executemany("INSERT INTO t (data) VALUES (%s)", [1, 2, 3]) is no more valid args. You need to use sequence of tuple (e.g. [(1,), (2,), (3,)]) instead.
Full Changelog: v2.1.1...v2.2.0rc1
Fix qualname of exception classes.
Release: 2022-06-22
Fix qualname of exception classes. (#522)
Fix range check in MySQLdb._mysql.result.fetch_row(). Invalid how argument caused SEGV. (#538)
Fix docstring of _mysql.connect. (#540)
Use MariaDB Connector/C 3.3.1.
Use cibuildwheel to build wheels.
Python 3.8-3.11
Deprecate passwd and db keyword. Use password and database instead. (#488).
Release: 2021-11-17
Add multistatement=True option. You can disable multi statement. (#500).
Remove unnecessary bytes encoder which is remained for Django 1.11 compatibility (#490).
Deprecate passwd and db keyword. Use password and database instead. (#488).
Windows: Binary wheels are built with MariaDB Connector/C 3.2.4. (#508)
set_character_set() sends SET NAMES query always. This means all new connections send it too. This solves compatibility issues when server and client library are different version. (#509)
Remove escape() and escape_string() from MySQLdb package. (#511)
Add Python 3.10 support and drop Python 3.5 support.
Nothing published for this version
Add -std=c99 option to cflags by default for ancient compilers that doesn't accept C99 by default.
Release: 2021-01-01
Add -std=c99 option to cflags by default for ancient compilers that doesn't accept C99 by default.
You can customize cflags and ldflags by setting MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS. It overrides mysql_config.
Windows: Update MariaDB Connector/C to 3.1.11.
Release: 2020-12-10
Windows: Update MariaDB Connector/C to 3.1.11.
Optimize fetching many rows with DictCursor.
Fixed multithread safety issue in fetching row.
Release: 2020-07-03
Fixed multithread safety issue in fetching row.
Removed obsolete members from Cursor. (e.g. messages, _warnings, _last_executed)
Add context manager interface to Connection which closes the connection on __exit__.
Release: 2020-07-02
Dropped Python 2 support
Dropped Django 1.11 support
Add context manager interface to Connection which closes the connection on __exit__.
Add ssl_mode option.
The cp1252 encoding is used when charset is "latin1".
Release: 2019-11-21
The cp1252 encoding is used when charset is "latin1". (#390)
The auth_plugin option is added.
Release: 2019-11-06
The auth_plugin option is added. (#389)
charset option is passed to mysql_options(mysql, MYSQL_SET_CHARSET_NAME, charset) before mysql_real_connect is called. This avoid extra SET NAMES quer
Release: 2019-08-12
charset option is passed to mysql_options(mysql, MYSQL_SET_CHARSET_NAME, charset) before mysql_real_connect is called. This avoid extra SET NAMES <charset> query when creating connection.
--static build supports libmariadbclient.a
Release: 2019-08-09
--static build supports libmariadbclient.a
Try mariadb_config when mysql_config is not found
Fixed warning happened in Python 3.8 (#359)
Fixed from MySQLdb import *, while I don't recommend it. (#369)
Fixed SEGV MySQLdb.escape_string("1") when libmariadb is used and no connection is created. (#367)
Fixed many circular references are created in Cursor.executemany(). (#375)
Nothing published for this version
Fix Django 1.11 compatibility. (#327) mysqlclient 1.5 will not support Django 1.11. It is not because mysqlclient will break backward compatibility, b
Release: 2019-02-08
Fix Django 1.11 compatibility. (#327) mysqlclient 1.5 will not support Django 1.11. It is not because mysqlclient will break backward compatibility, but Django used unsupported APIs and Django 1.11 don't fix bugs including compatibility issues.
Fix dict parameter support (#323, regression of 1.4.0)
Release: 2019-01-19
Fix dict parameter support (#323, regression of 1.4.0)
Remove some deprecated cursor classes and methods.
Release: 2019-01-18
Dropped Python 3.4 support.
Removed threadsafe and embedded build options.
Remove some deprecated cursor classes and methods.
_mysql and _mysql_exceptions modules are moved under MySQLdb package. (#293)
Remove errorhandler from Connection and Cursor classes.
Remove context manager API from Connection. It was for transaction. New context manager API for closing connection will be added in future version.
Remove waiter option from Connection.
Remove escape_sequence, and escape_dict methods from Connection class.
Remove automatic MySQL warning checking.
Drop support for MySQL Connector/C with MySQL<5.1.12.
Remove _mysql.NULL constant.
Remove _mysql.thread_safe() function.
Support non-ASCII field name with non-UTF-8 connection encoding. (#210)
Optimize decoding speed of string and integer types.
Remove MySQLdb.constants.REFRESH module.
Remove support for old datetime format for MySQL < 4.1.
Fix wrong errno is raised when mysql_real_connect is failed. (#316)
Nothing published for this version
Nothing published for this version
Nothing published for this version
waiter option is now deprecated.
Release: 2018-12-04
Support static linking of MariaDB Connector/C (#265)
Better converter for Decimal and Float (#267, #268, #273, #286)
Add Connection._get_native_connection for XTA project (#269)
Fix SEGV on MariaDB Connector/C when some methods of Connection objects are called after Connection.close() is called. (#270, #272, #276) See https://jira.mariadb.org/browse/CONC-289
Fix Connection.client_flag (#266)
Fix SSCursor may raise same exception twice (#282)
This removed Cursor._last_executed which was duplicate of Cursor._executed. Both members are private. So this type of changes are not documented in changelog generally. But Django used the private member for last_executed_query implementation. If you use the method the method directly or indirectly, this version will break your application. See https://code.djangoproject.com/ticket/30013
waiter option is now deprecated. (#285)
Fixed SSL support is not detected when built with MySQL < 5.1 (#291)
Fix decoding tiny/medium/long blobs
Support build with MySQL 8
Fix decoding tiny/medium/long blobs (#215)
Remove broken row_seek() and row_tell() APIs (#220)
Reduce callproc roundtrip time (#223)
InterfaceError is raised when Connection.query() is called for closed connection
Fix tuple argument again (#201)
InterfaceError is raised when Connection.query() is called for closed connection (#202)
Support MariaDB 10.2 client library (#197, #177, #200)
Support MariaDB 10.2 client library (#197, #177, #200)
Add NEWDECIMAL to the NUMBER DBAPISet (#167)
Allow bulk insert which no space around VALUES (#179)
Fix leak of connection->converter. (#182)
Support error numbers > CR_MAX_ERROR (#188)
Fix tuple argument support (#145)
Nothing published for this version
Deprecate context interface of Connection object.
Added binary_prefix option (disabled by default) to support _binary prefix again. (#134)
Fix SEGV of _mysql.result() when argument's type is unexpected. (#138)
Deprecate context interface of Connection object. (#149)
Don't use workaround of bytes.decode('ascii', 'surrogateescape') on Python 3.6+. (#150)
Revert adding _binary prefix for bytes/bytearray parameter. It broke backward compatibility.
Revert adding _binary prefix for bytes/bytearray parameter. It broke backward compatibility.
Fix Windows compile error on MSVC.
Use _binary prefix for bytes/bytearray parameters
Update error constants (#113)
Use _binary prefix for bytes/bytearray parameters (#106)
Use mysql_real_escape_string_quote() if exists (#109)
Better Warning propagation (#101)
Fix conversion error when mysql_affected_rows returns -1
Fix Cursor.callproc may raise TypeError (#90, #91)
connect() supports the 'database' and 'password' keyword arguments.
Fix accessing dangling pointer when using ssl (#78)
Accept %% in Cursor.executemany (#83)
Fix warning that caused TypeError on Python 3 (#68)
Support link args other than '-L' and '-l' from mysql_config.
Support link args other than '-L' and '-l' from mysql_config.
Missing value for column without default value cause IntegrityError. (#33)
Support BIT type. (#38)
More tests for date and time columns. (#41)
Fix calling .execute() method for closed cursor cause TypeError. (#37)
Improve performance to parse date. (#43)
Support geometry types (#49)
Fix warning while multi statement cause ProgrammingError. (#48)
Fix escape_string() doesn't work.
Fix escape_string() doesn't work.
Remove Cursor.__del__ to fix uncollectable circular reference on Python 3.3.
Add context manager support to Cursor. It automatically closes cursor on __exit__.
with conn.cursor() as cur:
cur.execute("SELECT 1+1")
print(cur.fetchone())
# cur is now closed
Fix TINYBLOB, MEDIUMBLOB and LONGBLOB are treated as string and decoded to unicode or cause UnicodeError.
Fix TINYBLOB, MEDIUMBLOB and LONGBLOB are treated as string and decoded to unicode or cause UnicodeError.
Fix aware datetime is formatted with timezone offset (e.g. "+0900").
Fix compile error when using libmariadbclient.
Remove compiler warnings.
Fix compile error when using libmariadbclient.
Fix GIL deadlock while dealloc.
Fix exception reraising doesn't work.
Fix exception reraising doesn't work.
Add send_query() and read_query_result() method to low level connection.
Add send_query() and read_query_result() method to low level connection.
Add waiter option.
This is a first fork of MySQL-python. Now named "mysqlclient"
This is a first fork of MySQL-python. Now named "mysqlclient"
Support Python 3
Add autocommit option
Support microsecond in datetime field.
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →