Python Connector for MySQL
Python Connector for MySQL is a connectivity solution for accessing MySQL databases from Python applications. It fully implements the Python DB API 2.0 specification. The connector is distributed as a wheel package for Windows, macOS, and Linux.
Direct connection
The connector enables you to establish a direct connection to MySQL from a Python application via TCP/IP, eliminating the need for the database client library. A direct connection increases the speed of data transmission between the application and MySQL database server. It also streamlines the deployment process since you don't have to distribute any client libraries with the application.
Secure communication
The connector supports encrypted communications using SSL/TLS, SSH tunneling, and HTTP/HTTPS tunneling.
Connecting
To establish a connection to a MySQL database, import the connector and use
the connect() method with your connection parameters.
Import the connector
First, import the MySQL connector module:
import devart.mysql as mysql
Establish a connection
Call the connect() method and obtain a connection object.
my_connection = mysql.connect(
Server="your_server", Database="your_database", UserId="your_username", Password="your_password"
)
Replace the example values with your actual connection values.
Querying data
Once connected to MySQL, you can execute SQL queries to retrieve data from your MySQL database.
Execute a query
Create a cursor object using the cursor() connection method.
my_cursor = my_connection.cursor()
Execute a SQL query using the execute() cursor method.
my_cursor.execute("SELECT * FROM employees")
Retrieve results using one of the fetch*() methods.
for row in my_cursor.fetchall():
print(row)
Parameterized queries
You can use parameterized queries to pass variable values to your SQL statements. This allows you to reuse the same query with different data and helps to prevent SQL injection attacks.
Pass parameters as a list or tuple to the execute() method:
query = "SELECT Id, Name FROM Contact WHERE Name = ? AND Email = ?"
params = ["Jordan Sanders", "jordansanders@example.com"]
my_cursor.execute(query, params)
results = my_cursor.fetchall()
for row in results:
print(row)
Each placeholder ? in the query is replaced with a corresponding value from the parameter list.
Ordering and activating the license
You can purchase a license for the connector on the ordering page:
https://www.devart.com/python/mysql/ordering.html
To activate the license, follow the instructions in the documentation:
https://docs.devart.com/python/mysql/activate-a-license.htm
What's new
Python Connector for MySQL 1.4
- Added support for Python 3.15
- Added support for MySQL 9.7
- Added support for generated columns
- Added support for handling the new ER_CLIENT_INTERACTION_TIMEOUT error packet
- Added support for the authentication_ldap_sasl authentication plugin with the GSSAPI mechanism
- Improved support for the GSSAPI authentication plugin
Metadata
Release files for devart-mysql-connector 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 48.1 MB
Release files / devart_mysql_connector-1.4.0-cp315-cp315-win_amd64.whl
| Download URL | devart_mysql_connector-1.4.0-cp315-cp315-win_amd64.whl |
|---|---|
| Size | 998.4 kB |
| Tags | CPython 3.15 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
bc5ed94eb8510a9a0c1bed5e600bb09f4aba4daebf39e1c037d45a2fe71c5b3a
|
|
BLAKE2b-256 checksum How to use checksums |
acc8f092a80aae37a25ec88c608488342688fb43047a658d16833066e1ec0882
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp315-cp315-win32.whl
| Download URL | devart_mysql_connector-1.4.0-cp315-cp315-win32.whl |
|---|---|
| Size | 850.6 kB |
| Tags | CPython 3.15 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
1eb3d00ff15e4acdf3395a3b39f10fb9b403bcfe2f07def8b061c91f0f1c5b93
|
|
BLAKE2b-256 checksum How to use checksums |
6b0a8705adadf277f99869cf5af77a51782dc26cb503d3112c062b4a9000dd35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp315-cp315-manylinux_2_34_x86_64.whl
| Download URL | devart_mysql_connector-1.4.0-cp315-cp315-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.15 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
f67a33fa7bde175a348cb4165d2dde756c4d2095bba094c7615c89f982a33b6d
|
|
BLAKE2b-256 checksum How to use checksums |
3aa3d425c4e1d709e09f49f7731c47827c963fa2ce7615e54ce78b427c901477
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp315-cp315-macosx_10_15_universal2.whl
| Download URL | devart_mysql_connector-1.4.0-cp315-cp315-macosx_10_15_universal2.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.15 macOS 10.15+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
29a734c9410a239c6f0b80362a296d6a826b81cb0592613c20aa71038361ef50
|
|
BLAKE2b-256 checksum How to use checksums |
7c1e9d60d1fa4fb969a4990cacd05df2a5d5b13604e705855a3447613d1e0d14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp314-cp314-win_amd64.whl
| Download URL | devart_mysql_connector-1.4.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 998.3 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8296833f712318ea364e05bdbd508f8305fff9449f76bf5ac858d695ea5fc892
|
|
BLAKE2b-256 checksum How to use checksums |
934f05cd289a418990cfba2af5ad1507f4b7c55172d7a3c7e63cce2fe192974a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp314-cp314-win32.whl
| Download URL | devart_mysql_connector-1.4.0-cp314-cp314-win32.whl |
|---|---|
| Size | 850.5 kB |
| Tags | CPython 3.14 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
d4571f4c9842eb099663090fb223803388a9a0fe21de7da07b59c7c664d5735e
|
|
BLAKE2b-256 checksum How to use checksums |
39f8993cbea01ed81492c368b892bd027b03c63a5596574c2db41137c57b67d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp314-cp314-manylinux_2_34_x86_64.whl
| Download URL | devart_mysql_connector-1.4.0-cp314-cp314-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.14 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
acfe4bb592dc6292d78088e2bc824e3e5ced479b53a55d380b3d5004969647b9
|
|
BLAKE2b-256 checksum How to use checksums |
fcdf68c9825f00c92cac811234481691ad7385f28f8e583823d1f1499ed87206
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp314-cp314-macosx_10_15_universal2.whl
| Download URL | devart_mysql_connector-1.4.0-cp314-cp314-macosx_10_15_universal2.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.14 macOS 10.15+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
702a96ae20b7d0f865387d69e32b23ef3fb4830404ddd98594f7def0be3537e0
|
|
BLAKE2b-256 checksum How to use checksums |
6fbe3816ea7d038fc08be8c9ad02b5d5d42807c542fbe0709a97012d6957f2ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp313-cp313-win_amd64.whl
| Download URL | devart_mysql_connector-1.4.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 996.3 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d4b2df818b72647eb8fbf7dafa4f97c0967116f3d77effe12e2f3b33a2f4707d
|
|
BLAKE2b-256 checksum How to use checksums |
4b952e06819574e9cb98276c0b51ddf3d161248d35bfa8001056f632b5b6b75c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp313-cp313-win32.whl
| Download URL | devart_mysql_connector-1.4.0-cp313-cp313-win32.whl |
|---|---|
| Size | 849.3 kB |
| Tags | CPython 3.13 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
b9ce755a8945533c834cb6f9c0056cdbf9c0ec550854669291adc8c5c6d848bb
|
|
BLAKE2b-256 checksum How to use checksums |
2081e9db78b5eac3818c6d57218c2667dd8ef8341e9acd4d0c03c797f9e9319f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp313-cp313-manylinux_2_34_x86_64.whl
| Download URL | devart_mysql_connector-1.4.0-cp313-cp313-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.13 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
ffa1466dd9045e0f9ac54fbdc21174df53f3cafcf8853e5562abebfe2d4a9fd2
|
|
BLAKE2b-256 checksum How to use checksums |
cdf3e2c3aa2833b6333e4363fbc03ddf0285e4062687b11bd680b9451e21f4d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp313-cp313-macosx_10_13_universal2.whl
| Download URL | devart_mysql_connector-1.4.0-cp313-cp313-macosx_10_13_universal2.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
f5f73cdc0ca642c7dd59910d240b227ad20cc740c7e711fe9880a6b419457a11
|
|
BLAKE2b-256 checksum How to use checksums |
94461d883296d005f6e7a987af8c38aba2f9f8dc3e57e17b7fc0c4c67f5e11e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp312-cp312-win_amd64.whl
| Download URL | devart_mysql_connector-1.4.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 996.3 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
475de93a3b1d4549d7802ab648ecf807738331c19e3b8fcc75758a0bc2fecbb5
|
|
BLAKE2b-256 checksum How to use checksums |
3f5fb5f02fd6f3cd5daecadc7a6e2aff9c2aff190031b13eba664474c7858e1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp312-cp312-win32.whl
| Download URL | devart_mysql_connector-1.4.0-cp312-cp312-win32.whl |
|---|---|
| Size | 849.3 kB |
| Tags | CPython 3.12 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
7d2ad177cbb8af2ccd79f169201c675a8df69bf17bdb80a01ef255d28cfa0ed3
|
|
BLAKE2b-256 checksum How to use checksums |
ef4f2d7c37b194025ed77afcd66dbec2be5a6e38e8e7a0e0d44cb6fb2996581f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp312-cp312-manylinux_2_34_x86_64.whl
| Download URL | devart_mysql_connector-1.4.0-cp312-cp312-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.12 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
25fcd9fdad40fc3c13a4d7c1ed92734c37d62eb111ef566b2627f52c2528c70d
|
|
BLAKE2b-256 checksum How to use checksums |
196f7803e31419e978cd5bd3bf1279727e8c9d19092386904c54373e683d86eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp312-cp312-macosx_10_9_universal2.whl
| Download URL | devart_mysql_connector-1.4.0-cp312-cp312-macosx_10_9_universal2.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
a06230fd51e7aa80693e8982fb3e4f11e40df85f080f15b71d16b2d93302009f
|
|
BLAKE2b-256 checksum How to use checksums |
2398faedb6ef3485298c101fa437272a1315068d83c78488de04b9c011313d49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp311-cp311-win_amd64.whl
| Download URL | devart_mysql_connector-1.4.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 996.3 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3e92dce8ae2c11ed6687aac333e7524fbbdbcb1e5987372a0e7825c8987c9c5d
|
|
BLAKE2b-256 checksum How to use checksums |
4adc7adf679d7eb6477d88d0b5607d339c51a9b3869fa6a5f94fe0a24ae01017
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp311-cp311-win32.whl
| Download URL | devart_mysql_connector-1.4.0-cp311-cp311-win32.whl |
|---|---|
| Size | 849.3 kB |
| Tags | CPython 3.11 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
63233d5b5887ede3a8f77f2decdec7e602518a6da0335931dd358cb494c69ab7
|
|
BLAKE2b-256 checksum How to use checksums |
81d3c1503524db6b4f3a3cdcebda6b84273b0c84b6747e3fca18d02f460154b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp311-cp311-manylinux_2_34_x86_64.whl
| Download URL | devart_mysql_connector-1.4.0-cp311-cp311-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.11 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
34e832c0ecbcb7316d1ab655c71fee7089cc6cbbc166b93c6732bbfb1c8ab254
|
|
BLAKE2b-256 checksum How to use checksums |
25699a324816ec03c3e3d11bcb111b360d09354a173f4d94ed3863aa598f10bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp311-cp311-macosx_10_9_universal2.whl
| Download URL | devart_mysql_connector-1.4.0-cp311-cp311-macosx_10_9_universal2.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
a75d5f81f08dee90611924f022d5ecef0e83df2b91499f6fe7e379a6153adbad
|
|
BLAKE2b-256 checksum How to use checksums |
b55bbbaed7c83845a8fbc0dade198bff89d787063b8f4b37fb4a425e90e403be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp310-cp310-win_amd64.whl
| Download URL | devart_mysql_connector-1.4.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 995.7 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
354b8c9b189c952d9b84ab1e78857260117601d41dfa6189afa24dc9c3670e51
|
|
BLAKE2b-256 checksum How to use checksums |
e61224061471df499792adfa4bfdaa70ff068e0d400f5750f1986cce84d42561
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp310-cp310-win32.whl
| Download URL | devart_mysql_connector-1.4.0-cp310-cp310-win32.whl |
|---|---|
| Size | 849.3 kB |
| Tags | CPython 3.10 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
6467262e154e8a5d344a7109f7b8c464c2b3ad4f1216fbc9de433be8d371836b
|
|
BLAKE2b-256 checksum How to use checksums |
cfc55e231d26ec66cb55031e26083f4f67c11d0d2de25675c30761dbb3f40f03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp310-cp310-manylinux_2_34_x86_64.whl
| Download URL | devart_mysql_connector-1.4.0-cp310-cp310-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
1c5c90d213dd39b6abdf02fc0b1f8fc3d8970dd34863340828825b061a271f57
|
|
BLAKE2b-256 checksum How to use checksums |
26a98ff98e6224cbd48956879add9957a9b501d19a48f3cddd3b532c55710d40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Release files / devart_mysql_connector-1.4.0-cp310-cp310-macosx_10_9_universal2.whl
| Download URL | devart_mysql_connector-1.4.0-cp310-cp310-macosx_10_9_universal2.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) |
|
SHA-256 checksum How to use checksums |
a959bf606e629f0c036b617b7875b8e61c57c2aecfdbe78e9946ff1a195d096e
|
|
BLAKE2b-256 checksum How to use checksums |
c0c9775408f319158bf253b039675805d1c2baa13882422b9aa606063af04a28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.4
|
Security for devart-mysql-connector 1.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.