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.4.0.tar.gz (12.2 MB view details)

Uploaded Source

Built Distributions

mysql_connector_python-9.4.0-py2.py3-none-any.whl (406.6 kB view details)

Uploaded Python 2Python 3

mysql_connector_python-9.4.0-cp313-cp313-win_amd64.whl (16.4 MB view details)

Uploaded CPython 3.13Windows x86-64

mysql_connector_python-9.4.0-cp313-cp313-manylinux_2_28_x86_64.whl (33.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

mysql_connector_python-9.4.0-cp313-cp313-manylinux_2_28_aarch64.whl (33.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

mysql_connector_python-9.4.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.4.0-cp313-cp313-macosx_14_0_arm64.whl (17.5 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

mysql_connector_python-9.4.0-cp312-cp312-win_amd64.whl (16.4 MB view details)

Uploaded CPython 3.12Windows x86-64

mysql_connector_python-9.4.0-cp312-cp312-manylinux_2_28_x86_64.whl (33.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

mysql_connector_python-9.4.0-cp312-cp312-manylinux_2_28_aarch64.whl (33.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

mysql_connector_python-9.4.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.4.0-cp312-cp312-macosx_14_0_arm64.whl (17.5 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

mysql_connector_python-9.4.0-cp311-cp311-win_amd64.whl (16.4 MB view details)

Uploaded CPython 3.11Windows x86-64

mysql_connector_python-9.4.0-cp311-cp311-manylinux_2_28_x86_64.whl (33.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

mysql_connector_python-9.4.0-cp311-cp311-manylinux_2_28_aarch64.whl (33.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

mysql_connector_python-9.4.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.4.0-cp311-cp311-macosx_14_0_arm64.whl (17.5 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

mysql_connector_python-9.4.0-cp310-cp310-win_amd64.whl (16.4 MB view details)

Uploaded CPython 3.10Windows x86-64

mysql_connector_python-9.4.0-cp310-cp310-manylinux_2_28_x86_64.whl (33.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

mysql_connector_python-9.4.0-cp310-cp310-manylinux_2_28_aarch64.whl (33.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

mysql_connector_python-9.4.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.4.0-cp310-cp310-macosx_14_0_arm64.whl (17.5 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

mysql_connector_python-9.4.0-cp39-cp39-win_amd64.whl (16.4 MB view details)

Uploaded CPython 3.9Windows x86-64

mysql_connector_python-9.4.0-cp39-cp39-manylinux_2_28_x86_64.whl (33.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

mysql_connector_python-9.4.0-cp39-cp39-manylinux_2_28_aarch64.whl (33.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

mysql_connector_python-9.4.0-cp39-cp39-macosx_14_0_x86_64.whl (18.4 MB view details)

Uploaded CPython 3.9macOS 14.0+ x86-64

mysql_connector_python-9.4.0-cp39-cp39-macosx_14_0_arm64.whl (17.5 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for mysql_connector_python-9.4.0.tar.gz
Algorithm Hash digest
SHA256 d111360332ae78933daf3d48ff497b70739aa292ab0017791a33e826234e743b
MD5 3faf135731630a3d7a76e84f196a29ed
BLAKE2b-256 02772b45e6460d05b1f1b7a4c8eb79a50440b4417971973bb78c9ef6cad630a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 56e679169c704dab279b176fab2a9ee32d2c632a866c0f7cd48a8a1e2cf802c4
MD5 7f3e1382a22303d9ae6fb71eec536700
BLAKE2b-256 3634b6165e15fd45a8deb00932d8e7d823de7650270873b4044c4db6688e1d8f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c727cb1f82b40c9aaa7a15ab5cf0a7f87c5d8dce32eab5ff2530a4aa6054e7df
MD5 e6a3797e11034d8c06d84bb7c27c15a7
BLAKE2b-256 6415cbd996d425c59811849f3c1d1b1dae089a1ae18c4acd4d8de2b847b772df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5163381a312d38122eded2197eb5cd7ccf1a5c5881d4e7a6de10d6ea314d088e
MD5 bd3dff76430522b0d8a64ed0c43a71b4
BLAKE2b-256 d19b712053216fcbe695e519ecb1035ffd767c2de9f51ccba15078537c99d6fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 227dd420c71e6d4788d52d98f298e563f16b6853577e5ade4bd82d644257c812
MD5 8daec15486d9ca6749870cc6aa48f32e
BLAKE2b-256 07bdaf0de40a01d5cb4df19318cc018e64666f2b7fa89bffa1ab5b35337aae2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp313-cp313-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 25f77ad7d845df3b5a5a3a6a8d1fed68248dc418a6938a371d1ddaaab6b9a8e3
MD5 09eb72388d7a96621a74310dbdb07b02
BLAKE2b-256 31dfb89e6551b91332716d384dcc3223e1f8065902209dcd9e477a3df80154f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 fde3bbffb5270a4b02077029914e6a9d2ec08f67d8375b4111432a2778e7540b
MD5 0c9ac4de2880babe4b63236050a20571
BLAKE2b-256 79e213036479cd1070d1080cee747de6c96bd6fbb021b736dd3ccef2b19016c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 57b0c224676946b70548c56798d5023f65afa1ba5b8ac9f04a143d27976c7029
MD5 5b5cae894b25c7089dc86753e233e1ef
BLAKE2b-256 cb6936b989de675d98ba8ff7d45c96c30c699865c657046f2e32db14e78f13d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b3436a2c8c0ec7052932213e8d01882e6eb069dbab33402e685409084b133a1c
MD5 6a03ca2e413d4eeffc5b814fa91f06d0
BLAKE2b-256 455a1b053ae80b43cd3ccebc4bb99a98826969b3b0f8adebdcc2530750ad76ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 815aa6cad0f351c1223ef345781a538f2e5e44ef405fdb3851eb322bd9c4ca2b
MD5 552708f0ddf36b687d6b028c1ac31117
BLAKE2b-256 b4fdf426f5f35a3d3180c7f84d1f96b4631be2574df94ca1156adab8618b236c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp312-cp312-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 665c13e7402235162e5b7a2bfdee5895192121b64ea455c90a81edac6a48ede5
MD5 d77f0e605a52a1c287589b3866b063ec
BLAKE2b-256 cb6ec22fbee05f5cfd6ba76155b6d45f6261d8d4c1e36e23de04e7f25fbd01a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4efa3898a24aba6a4bfdbf7c1f5023c78acca3150d72cc91199cca2ccd22f76f
MD5 c5231576ff51debe3d6e03fe9a80c8d2
BLAKE2b-256 037ca543fb17c2dfa6be8548dfdc5879a0c7924cd5d1c79056c48472bb8fe858

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fd6ff5afb9c324b0bbeae958c93156cce4168c743bf130faf224d52818d1f0ee
MD5 b3c58156cc4ad48dc6cce0c5c8488c10
BLAKE2b-256 159c127f974ca9d5ee25373cb5433da06bb1f36e05f2a6b7436da1fe9c6346b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b27fcd403436fe83bafb2fe7fcb785891e821e639275c4ad3b3bd1e25f533206
MD5 fe49131e59891fa473092adec6015046
BLAKE2b-256 16a84f99d80f1cf77733ce9a44b6adb7f0dd7079e7afa51ca4826515ef0c3e16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d3e87142103d71c4df647ece30f98e85e826652272ed1c74822b56f6acdc38e7
MD5 50ea4f680edc6c0eacb5f92e6e507744
BLAKE2b-256 25146510a11ed9f80d77f743dc207773092c4ab78d5efa454b39b48480315d85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp311-cp311-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 3892f20472e13e63b1fb4983f454771dd29f211b09724e69a9750e299542f2f8
MD5 bf2923671815e800eba81996a2b17b51
BLAKE2b-256 c0bfca596c00d7a6eaaf8ef2f66c9b23cd312527f483073c43ffac7843049cb4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 7df1a8ddd182dd8adc914f6dc902a986787bf9599705c29aca7b2ce84e79d361
MD5 dadad6ecb0118f95b3939e681bcd0a11
BLAKE2b-256 fe0c4365a802129be9fa63885533c38be019f1c6b6f5bcf8844ac53902314028

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7106670abce510e440d393e27fc3602b8cf21e7a8a80216cc9ad9a68cd2e4595
MD5 00287bdddf515b3c6573f5bdc6d7b39d
BLAKE2b-256 2c116907d53349b11478f72c8f22e38368d18262fbffc27e0f30e365d76dad93

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0f5ad70355720e64b72d7c068e858c9fd1f69b671d9575f857f235a10f878939
MD5 e67530af78f6b723ae79a085280ef3a7
BLAKE2b-256 0fec86dfefd3e6c0fca13085bc28b7f9baae3fce9f6af243d8693729f6b5063c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 f14b6936cd326e212fc9ab5f666dea3efea654f0cb644460334e60e22986e735
MD5 27f30ba1d4f45f0edb54ee99ab903b81
BLAKE2b-256 40561bea00f5129550bcd0175781b9cd467e865d4aea4a6f38f700f34d95dcb8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp310-cp310-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 47884fcb050112b8bef3458e17eac47cc81a6cbbf3524e3456146c949772d9b4
MD5 507e37871f5a79e5f80c9b2508a3caf3
BLAKE2b-256 3c3909ae7082c77a978f2d72d94856e2e57906165c645693bc3a940bcad3a32d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3c2603e00516cf4208c6266e85c5c87d5f4d0ac79768106d50de42ccc8414c05
MD5 fc05112d5e60ce8492ac0b52d8bf3c3a
BLAKE2b-256 a2ef1a35d9ebfaf80cf5aa238be471480e16a69a494d276fb07b889dc9a5cfc3

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.4.0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a8f820c111335f225d63367307456eb7e10494f87e7a94acded3bb762e55a6d4
MD5 824d312c7110b44c1dd6be75962da2d8
BLAKE2b-256 0ca4b1e2adc65121e7eabed06d09bed87638e7f9a51e9b5dbb1cfb17b58b1181

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.4.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1c6b95404e80d003cd452e38674e91528e2b3a089fe505c882f813b564e64f9d
MD5 0912ec07ab76510f2ef08196fc13d299
BLAKE2b-256 ddc7aa6f4cc2e5e3fb68b5a6bba680429b761e387b8a040cf16a5f17e0b09df6

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.4.0-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4ee4fe1b067e243aae21981e4b9f9d300a3104814b8274033ca8fc7a89b1729e
MD5 d43783d668d8981eff49eb0765203770
BLAKE2b-256 86e9dc31eeffe33786016e1370be72f339544ee00034cb702c0b4a3c6f5c1585

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.4.0-cp39-cp39-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp39-cp39-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 7b8976d89d67c8b0dc452471cb557d9998ed30601fb69a876bf1f0ecaa7954a4
MD5 23c3bdfde16b56a4d6a90b45a2c9fb07
BLAKE2b-256 a02365e801f74b3fcc2a6944242d64f0d623af48497e4d9cf55419c2c6d6439b

See more details on using hashes here.

File details

Details for the file mysql_connector_python-9.4.0-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mysql_connector_python-9.4.0-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 20f8154ab5c0ed444f8ef8e5fa91e65215037db102c137b5f995ebfffd309b78
MD5 6fb9d62e4740d7ef7af7a06c546e80fd
BLAKE2b-256 6d36b32635b69729f144d45c0cbcd135cfd6c480a62160ac015ca71ebf68fca7

See more details on using hashes here.

Supported by

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