skillfed

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).

mysql-connector-python Copyleft license GNU GPLv2 (with FOSS License Exception) Active 958 v26.7.0 released

Install

mysql-connector-python on PyPI

pip

pip install mysql-connector-python

uv

uv add mysql-connector-python

poetry

poetry add mysql-connector-python

Package 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: EducationLicense :: OSI Approved :: GNU General Public License (GPL)Operating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: DatabaseTopic :: Software DevelopmentTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

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.
mysql database driver pythonpep 249 mysql connectorpython mysql client librarymysql query execution pythondatabase connection mysql pythonmysql async connector pythonheatwave machine learning python

Similar packages