mysql-connector-python
A self-contained Python driver for communicating with MySQL servers, using an API that is compliant with the Python Database API Specification v2.0 (PEP 249).
Install
mysql-connector-python on PyPI
pip
pip install mysql-connector-pythonuv
uv add mysql-connector-pythonpoetry
poetry add mysql-connector-pythonPackage facts
| License | GNU GPLv2 (with FOSS License Exception) (copyleft) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 15 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: mysql_connector_python-26.7.0-py2.py3-none-any.whl
Keywords: mysql, database, db, connector, driver
About mysql-connector-python
from the package's own PyPI description — quoted content, verbatim
MySQL Connector/Python
.. image:: https://img.shields.io/pypi/v/mysql-connector-python.svg :target: https://pypi.org/project/mysql-connector-python/
.. image:: https://img.shields.io/pypi/pyversions/mysql-connector-python.svg :target: https://pypi.org/project/mysql-connector-python/
.. image:: https://img.shields.io/pypi/l/mysql-connector-python.svg :target: https://pypi.org/project/mysql-connector-python/
MySQL Connector/Python enables Python programs to access MySQL databases, using
an API that is compliant with the Python Database API Specification v2.0
(PEP 249) <https://www.python.org/dev/peps/pep-0249/>__.
Features
Asynchronous Connectivity <https://dev.mysql.com/doc/connector-python/en/connector-python-asyncio.html>__C-extension <https://dev.mysql.com/doc/connector-python/en/connector-python-cext.html>__Telemetry <https://dev.mysql.com/doc/connector-python/en/connector-python-opentelemetry.html>__
Licensing
Please refer to the README.txt <https://github.com/mysql/mysql-connector-python/blob/trunk/README.txt>__ and `LICENSE.txt...
Read as markdown · JSON record · Source repository · Homepage · Docs
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
MySQL Connector/Python is a self-contained driver that enables Python programs to connect to and query MySQL databases using the PEP 249 database API standard, with support for both classic and X DevAPI connectors.
Installation is straightforward via pip with no runtime dependencies, and the package is actively maintained with a recent release (15 days old). Supports Python 3.10–3.14 across Linux, macOS, and Windows.
Licensed under GNU GPLv2 with a FOSS License Exception, making it copyleft; you may use it freely in open-source projects, but proprietary applications must either comply with GPLv2 or seek an alternative license from MySQL.
Usage
pip install mysql-connector-python
import mysql.connector
cnx = mysql.connector.connect(host="127.0.0.1", user="root", password="pass")
cur = cnx.cursor()
cur.execute("SELECT 1")
print(cur.fetchone())
cnx.close()
Requires Python ≥3.10 and a running MySQL server accessible at the specified host and credentials.
Verdict: A production-stable, actively maintained official MySQL driver with zero known vulnerabilities, low install friction, and broad Python version support. The copyleft GPL license is a consideration for proprietary software; open-source projects and internal use face no barrier. Optional extras (telemetry, gssapi, webauthn, dns-srv) and HeatWave AI/ML integration are available but not installed by default.
Needs verification
- Whether the optional HeatWave AI/ML features (mysql.ai module) are production-ready or still experimental.
- Performance characteristics and C-extension availability across different platforms and Python versions.
Similar packages
permissive · top 1,000 on PyPI
PyMySQLpermissive · top 1,000 on PyPI
pyodbcpermissive · top 1,000 on PyPI
mysqlclientcopyleft · top 1,000 on PyPI
seleniumpermissive · top 1,000 on PyPI
aiosqlitepermissive · top 1,000 on PyPI
PyAthenapermissive · top 1,000 on PyPI
langchain-classicpermissive · top 1,000 on PyPI
langchain-corepermissive · top 1,000 on PyPI
google-cloud-automlpermissive · top 1,000 on PyPI