MySQL Connector/Python Developer Guide
Installation via pip is supported on Windows, macOS, and Linux platforms.
For macOS platforms, DMG installer packages were available for Connector/Python 8.0 and earlier.
Use pip to install and upgrade Connector/Python:
# Installation $> pip install mysql-connector-python # Upgrade $> pip install mysql-connector-python --upgrade # Optionally, install X DevAPI $> pip install mysqlx-connector-python # Upgrade X DevAPI $> pip install mysqlx-connector-python --upgrade
In case the wheel package you want to install is found in your local file system (for example, you produced a wheel package from a source distribution or downloaded it from somewhere), you can install it as follows:
# Installation
$ pip install /path/to/wheel/<wheel package name>
.whl
Installation from wheels allow you to install optional dependencies to enable certain features with Connector/Python. For example:
# 3rd party packages to enable the telemetry functionality are installed $ pip install mysql-connector-python[telemetry]
Similarly, for X DevAPI:
# 3rd party packages to enable the compression functionality are installed $ pip install mysqlx-connector-python[compression]
These installation options are shortcuts to install all the dependencies needed by some particular features (they are only for your convenience, and you can always install the required dependencies for a feature by yourself):
For the classic protocol:
dns-srv
gssapi
fido2
telemetry
For X Protocol:
dns-srv
compression
You can specify a multiple of these options in your installation command, for example:
$ pip install mysql-connector-python[telemetry,dns-srv,...
]
Or, if are installing a wheel package from your local file system:
$ pip install/path/to/wheel/<wheel package name>
.whl[telemetry,dns-srv,...
]