Skip to main content

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

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mysql_connector_python-9.5.0.tar.gz (12.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mysql_connector_python-9.5.0-py2.py3-none-any.whl (479.0 kB view details)

Uploaded Python 2Python 3

mysql_connector_python-9.5.0-cp314-cp314-win_amd64.whl (17.0 MB view details)

Uploaded CPython 3.14Windows x86-64

mysql_connector_python-9.5.0-cp314-cp314-manylinux_2_28_x86_64.whl (34.1 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

mysql_connector_python-9.5.0-cp314-cp314-manylinux_2_28_aarch64.whl (33.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ ARM64

mysql_connector_python-9.5.0-cp314-cp314-macosx_14_0_x86_64.whl (18.4 MB view details)

Uploaded CPython 3.14macOS 14.0+ x86-64

mysql_connector_python-9.5.0-cp314-cp314-macosx_14_0_arm64.whl (17.6 MB view details)

Uploaded CPython 3.14macOS 14.0+ ARM64

mysql_connector_python-9.5.0-cp313-cp313-win_amd64.whl (16.5 MB view details)

Uploaded CPython 3.13Windows x86-64

mysql_connector_python-9.5.0-cp313-cp313-manylinux_2_28_x86_64.whl (34.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

mysql_connector_python-9.5.0-cp313-cp313-manylinux_2_28_aarch64.whl (33.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

mysql_connector_python-9.5.0-cp313-cp313-macosx_14_0_x86_64.whl (18.4 MB view details)

Uploaded CPython 3.13macOS 14.0+ x86-64

mysql_connector_python-9.5.0-cp313-cp313-macosx_14_0_arm64.whl (17.6 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

mysql_connector_python-9.5.0-cp312-cp312-win_amd64.whl (16.5 MB view details)

Uploaded CPython 3.12Windows x86-64

mysql_connector_python-9.5.0-cp312-cp312-manylinux_2_28_x86_64.whl (34.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

mysql_connector_python-9.5.0-cp312-cp312-manylinux_2_28_aarch64.whl (33.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

mysql_connector_python-9.5.0-cp312-cp312-macosx_14_0_x86_64.whl (18.4 MB view details)

Uploaded CPython 3.12macOS 14.0+ x86-64

mysql_connector_python-9.5.0-cp312-cp312-macosx_14_0_arm64.whl (17.6 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

mysql_connector_python-9.5.0-cp311-cp311-win_amd64.whl (16.5 MB view details)

Uploaded CPython 3.11Windows x86-64

mysql_connector_python-9.5.0-cp311-cp311-manylinux_2_28_x86_64.whl (34.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

mysql_connector_python-9.5.0-cp311-cp311-manylinux_2_28_aarch64.whl (33.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

mysql_connector_python-9.5.0-cp311-cp311-macosx_14_0_x86_64.whl (18.4 MB view details)

Uploaded CPython 3.11macOS 14.0+ x86-64

mysql_connector_python-9.5.0-cp311-cp311-macosx_14_0_arm64.whl (17.6 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

mysql_connector_python-9.5.0-cp310-cp310-win_amd64.whl (16.5 MB view details)

Uploaded CPython 3.10Windows x86-64

mysql_connector_python-9.5.0-cp310-cp310-manylinux_2_28_x86_64.whl (34.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

mysql_connector_python-9.5.0-cp310-cp310-manylinux_2_28_aarch64.whl (33.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

mysql_connector_python-9.5.0-cp310-cp310-macosx_14_0_x86_64.whl (18.4 MB view details)

Uploaded CPython 3.10macOS 14.0+ x86-64

mysql_connector_python-9.5.0-cp310-cp310-macosx_14_0_arm64.whl (17.6 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

File details

Details for the file mysql_connector_python-9.5.0.tar.gz.

File metadata

  • Download URL: mysql_connector_python-9.5.0.tar.gz
  • Upload date:
  • Size: 12.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.21

File hashes

Hashes for mysql_connector_python-9.5.0.tar.gz
Algorithm Hash digest
SHA256 92fb924285a86d8c146ebd63d94f9eaefa548da7813bc46271508fdc6cc1d596
MD5 ccc69bb817e219036a3c5e6aae280ee0
BLAKE2b-256 3933b332b001bc8c5ee09255a0d4b09a254da674450edd6a3e5228b245ca82a0

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ace137b88eb6fdafa1e5b2e03ac76ce1b8b1844b3a4af1192a02ae7c1a45bdee
MD5 5182ea20e7999ea6216f004ef20d10dd
BLAKE2b-256 95e145373c06781340c7b74fe9b88b85278ac05321889a307eaa5be079a997d4

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 56104693478fd447886c470a6d0558ded0fe2577df44c18232a6af6a2bbdd3e9
MD5 90bc6a0d402d3d7c71ba56d1d66c7234
BLAKE2b-256 213abe129764fe5f5cd89a5aa3f58e7a7471284715f4af71097a980d24ebec0a

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a5fff063ed48281b7374a4da6b9ef4293d390c153f79b1589ee547ea08c92310
MD5 89089d7103f924738a0d3edd287edfee
BLAKE2b-256 58b7dcab48349ab8abafd6f40f113101549e0cf107e43dd9c7e1fae79799604b

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp314-cp314-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp314-cp314-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2797dd7bbefb1d1669d984cfb284ea6b34401bbd9c1b3bf84e646d0bd3a82197
MD5 d6208b3f69b879b5b4d465f8a6b78dbf
BLAKE2b-256 4a21a1a3247775d0dfee094499cb915560755eaa1013ac3b03e34a98b0e16e49

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp314-cp314-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp314-cp314-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 fd057bd042464eedbf5337d1ceea7f2a4ab075a1cf6d1d62ffd5184966a656dd
MD5 099531d5d9aa9340b5f703ae295bb524
BLAKE2b-256 f4a6bd800b42bde86bf2e9468dfabcbd7538c66daff9d1a9fc97d2cc897f96fa

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp314-cp314-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp314-cp314-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 6effda35df1a96d9a096f04468d40f2324ea36b34d0e9632e81daae8be97b308
MD5 ae4a1e3c20806ce05b51e6e0a6f55eaa
BLAKE2b-256 144252bef145028af1b8e633eb77773278a04b2cd9f824117209aba093018445

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 edd47048eb65c196b28aa9d2c0c6a017d8ca084a9a7041cd317301c829eb5a05
MD5 2675d5d2e2640c4ea3b210b86540ff78
BLAKE2b-256 e7f85e88e5eda1fe58f7d146b73744f691d85dce76fb42e7ce3de53e49911da3

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f6d32d7aa514d2f6f8709ba1e018314f82ab2acea2e6af30d04c1906fe9171b9
MD5 5c51abd1e2bfeff4a7dc9834904e054d
BLAKE2b-256 e8eed146d2642552ebb5811cf551f06aca7da536c80b18fb6c75bdbc29723388

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8972c1f960b30d487f34f9125ec112ea2b3200bd02c53e5e32ee7a43be6d64c1
MD5 860b6bd8141fe6cc8a3c5fc5fc40a155
BLAKE2b-256 6bf5ab306f292a99bff3544ff44ad53661a031dc1a11e5b1ad64b9e5b5290ef9

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp313-cp313-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp313-cp313-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 07bf52591b4215cb4318b4617c327a6d84c31978c11e3255f01a627bcda2618e
MD5 81a6044e2701dd790e3b7f5df1894655
BLAKE2b-256 de8e14d44db7353350006a12e46d61c3a995bba06acd7547fc78f9bb32611e0c

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 1f5f7346b0d5edb2e994c1bd77b3f5eed88b0ca368ad6788d1012c7e56d7bf68
MD5 5a1a08a3c4a35392f653e4844ee29a04
BLAKE2b-256 7218f221aeac49ce94ac119a427afbd51fe1629d48745b571afc0de49647b528

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b6c69cb37600b7e22f476150034e2afbd53342a175e20aea887f8158fc5e3ff6
MD5 6dc539ca09d6cbeb8e4472365f802906
BLAKE2b-256 cdef3d1a67d503fff38cc30e11d111cf28f0976987fb175f47b10d44494e1080

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a6e0a4a0274d15e3d4c892ab93f58f46431222117dba20608178dfb2cc4d5fd8
MD5 0ef7ea56e3383cbe3eda21bc856fe999
BLAKE2b-256 a60167cf210d50bfefbb9224b9a5c465857c1767388dade1004c903c8e22a991

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5ef7accbdf8b5f6ec60d2a1550654b7e27e63bf6f7b04020d5fb4191fb02bc4d
MD5 fbaa2b559861d4eef68d9b963a64031a
BLAKE2b-256 f6874c421f41ad169d8c9065ad5c46673c7af889a523e4899c1ac1d6bfd37262

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp312-cp312-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp312-cp312-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 bd9ba5a946cfd3b3b2688a75135357e862834b0321ed936fd968049be290872b
MD5 49d91d0d616d05372d63f3852eb0a179
BLAKE2b-256 6746630ca969ce10b30fdc605d65dab4a6157556d8cc3b77c724f56c2d83cb79

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 a72c2ef9d50b84f3c567c31b3bf30901af740686baa2a4abead5f202e0b7ea61
MD5 c68639455034cc5ceb96e4bffb2016e2
BLAKE2b-256 0289167ebee82f4b01ba7339c241c3cc2518886a2be9f871770a1efa81b940a0

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c021d8b0830958b28712c70c53b206b4cf4766948dae201ea7ca588a186605e0
MD5 c6ab8b695bd684cfe15380f41e7d7988
BLAKE2b-256 9c88bc13c33fca11acaf808bd1809d8602d78f5bb84f7b1e7b1a288c383a14fd

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7fdd3205b9242c284019310fa84437f3357b13f598e3f9b5d80d337d4a6406b8
MD5 b1c1725e1429a125121808fcebb68d24
BLAKE2b-256 90a2e6095dc3a7ad5c959fe4a65681db63af131f572e57cdffcc7816bc84e3ad

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 20950a5e44896c03e3dc93ceb3a5e9b48c9acae18665ca6e13249b3fe5b96811
MD5 749b43d9bff016effce15cb4a8c6ea5c
BLAKE2b-256 1cec054de99d4aa50d851a37edca9039280f7194cc1bfd30aab38f5bd6977ebe

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp311-cp311-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp311-cp311-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 5add93f60b3922be71ea31b89bc8a452b876adbb49262561bd559860dae96b3f
MD5 b7ac408db23dddd59ed0e9f59c0b939c
BLAKE2b-256 a5bb0f45c7ee55ebc56d6731a593d85c0e7f25f83af90a094efebfd5be9fe010

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 653e70cd10cf2d18dd828fae58dff5f0f7a5cf7e48e244f2093314dddf84a4b9
MD5 22e49f29f5b4b97f92f3c4d0683678ba
BLAKE2b-256 050377347d58b0027ce93a41858477e08422e498c6ebc24348b1f725ed7a67ae

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4f8d2d9d586c34dc9508a44d19cf30ccafabbbd12d7f8ab58da3af118636843c
MD5 94056510f6da394d2068b31bd9f5b6a4
BLAKE2b-256 3eb178dc693552cfbb45076b3638ca4c402fae52209af8f276370d02d78367a0

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 77c71df48293d3c08713ff7087cf483804c8abf41a4bb4aefea7317b752c8e9a
MD5 aac2dfd42c4938f4c7dabd8ac8167808
BLAKE2b-256 c56063135610ae0cee1260ce64874c1ddbf08e7fb560c21a3d9cce88b0ddc266

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 48ffa71ba748afaae5c45ed9a085a72604368ce611fe81c3fdc146ef60181d51
MD5 2d8fdf00307feeeed03e21c5d2bf7399
BLAKE2b-256 5ff24578b5093f46985c659035e880e70e8b0bed44d4a59ad4e83df5d49b9c69

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp310-cp310-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp310-cp310-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 4d603b55de310b9689bb3cb5e57fe97e98756e36d62f8f308f132f2c724f62b8
MD5 63beed73275bde4df348095d5995757e
BLAKE2b-256 7792ea79a0875436665330a81e82b4b73a6d52aebcfb1cf4d97f4ad4bd4dedf5

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.5.0-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.5.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 77d14c9fde90726de22443e8c5ba0912a4ebb632cc1ade52a349dacbac47b140
MD5 6cf741973994465ae3e408b548e26e18
BLAKE2b-256 535d30210fcf7ba98d1e03de0c47a58218ab5313d82f2e01ae53b47f45c36b9d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page