mysql-connector-python 9.5.0


pip install mysql-connector-python

  Latest version

Released: Oct 22, 2025


Meta
Author: Oracle and/or its affiliates
Requires Python: >=3.10

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers
  • Education

License
  • OSI Approved :: GNU General Public License (GPL)

Operating System
  • MacOS :: MacOS X
  • Microsoft :: Windows
  • POSIX :: Linux
  • Unix

Programming Language
  • Python :: 3
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Topic
  • Database
  • Software Development
  • Software Development :: Libraries :: Python Modules

Typing
  • Typed
https://img.shields.io/pypi/v/mysql-connector-python.svg https://img.shields.io/pypi/pyversions/mysql-connector-python.svg https://img.shields.io/pypi/l/mysql-connector-python.svg

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) - We refer to it as the Classic API.

Features

Installation

Connector/Python contains the classic and XDevAPI connector APIs, which are installed separately. Any of these can be installed from a binary or source distribution.

Binaries are distributed in the following package formats:

On the other hand, the source code is distributed as a compressed file from which a wheel package can be built.

The recommended way to install Connector/Python is via pip, which relies on WHEEL packages. For such a reason, it is the installation procedure that is going to be described moving forward.

Please, refer to the official MySQL documentation Connector/Python Installation to know more about installing from an RPM, or building and installing a WHEEL package from a source distribution.

Before installing a package with pip, it is strongly suggested to have the most recent pip version installed on your system. If your system already has pip installed, you might need to update it. Or you can use the standalone pip installer.

$ pip install mysql-connector-python

Installation Options

Connector packages included in MySQL Connector/Python allow you to install optional dependencies to unleash certain functionalities.

# 3rd party packages to unleash the telemetry functionality are installed
$ pip install mysql-connector-python[telemetry]

This installation option can be seen as a shortcut to install all the dependencies needed by a particular feature. Mind that this is optional and you are free to install the required dependencies by yourself.

Available options:

  • dns-srv

  • gssapi

  • webauthn

  • telemetry

Sample Code

import mysql.connector

# Connect to server
cnx = mysql.connector.connect(
    host="127.0.0.1",
    port=3306,
    user="mike",
    password="s3cre3t!")

# Get a cursor
cur = cnx.cursor()

# Execute a query
cur.execute("SELECT CURDATE()")

# Fetch one result
row = cur.fetchone()
print("Current date is: {0}".format(row[0]))

# Close connection
cnx.close()

Additional Resources

Contributing

There are a few ways to contribute to the Connector/Python code. Please refer to the contributing guidelines for additional information.

License

Please refer to the README.txt and LICENSE.txt files, available in this repository, for further details.

Wheel compatibility matrix

Platform CPython 3.10 CPython 3.11 CPython 3.12 CPython 3.13 CPython 3.14 Python 2 Python 3
any
macosx_14_0_arm64
macosx_14_0_x86_64
manylinux_2_28_aarch64
manylinux_2_28_x86_64
win_amd64

Files in release

mysql_connector_python-9.5.0-cp310-cp310-macosx_14_0_arm64.whl (16.8MiB)
mysql_connector_python-9.5.0-cp310-cp310-macosx_14_0_x86_64.whl (17.6MiB)
mysql_connector_python-9.5.0-cp310-cp310-manylinux_2_28_aarch64.whl (32.1MiB)
mysql_connector_python-9.5.0-cp310-cp310-manylinux_2_28_x86_64.whl (32.5MiB)
mysql_connector_python-9.5.0-cp310-cp310-win_amd64.whl (15.7MiB)
mysql_connector_python-9.5.0-cp311-cp311-macosx_14_0_arm64.whl (16.8MiB)
mysql_connector_python-9.5.0-cp311-cp311-macosx_14_0_x86_64.whl (17.6MiB)
mysql_connector_python-9.5.0-cp311-cp311-manylinux_2_28_aarch64.whl (32.1MiB)
mysql_connector_python-9.5.0-cp311-cp311-manylinux_2_28_x86_64.whl (32.5MiB)
mysql_connector_python-9.5.0-cp311-cp311-win_amd64.whl (15.7MiB)
mysql_connector_python-9.5.0-cp312-cp312-macosx_14_0_arm64.whl (16.8MiB)
mysql_connector_python-9.5.0-cp312-cp312-macosx_14_0_x86_64.whl (17.6MiB)
mysql_connector_python-9.5.0-cp312-cp312-manylinux_2_28_aarch64.whl (32.1MiB)
mysql_connector_python-9.5.0-cp312-cp312-manylinux_2_28_x86_64.whl (32.5MiB)
mysql_connector_python-9.5.0-cp312-cp312-win_amd64.whl (15.7MiB)
mysql_connector_python-9.5.0-cp313-cp313-macosx_14_0_arm64.whl (16.8MiB)
mysql_connector_python-9.5.0-cp313-cp313-macosx_14_0_x86_64.whl (17.6MiB)
mysql_connector_python-9.5.0-cp313-cp313-manylinux_2_28_aarch64.whl (32.1MiB)
mysql_connector_python-9.5.0-cp313-cp313-manylinux_2_28_x86_64.whl (32.5MiB)
mysql_connector_python-9.5.0-cp313-cp313-win_amd64.whl (15.7MiB)
mysql_connector_python-9.5.0-cp314-cp314-macosx_14_0_arm64.whl (16.8MiB)
mysql_connector_python-9.5.0-cp314-cp314-macosx_14_0_x86_64.whl (17.6MiB)
mysql_connector_python-9.5.0-cp314-cp314-manylinux_2_28_aarch64.whl (32.1MiB)
mysql_connector_python-9.5.0-cp314-cp314-manylinux_2_28_x86_64.whl (32.5MiB)
mysql_connector_python-9.5.0-cp314-cp314-win_amd64.whl (16.2MiB)
mysql_connector_python-9.5.0-py2.py3-none-any.whl (467.8KiB)
mysql_connector_python-9.5.0.tar.gz (11.7MiB)
Extras:
Dependencies: