Documentation Home
Connectors and APIs Manual
Download this Manual
PDF (US Ltr) - 4.5Mb
PDF (A4) - 4.5Mb


Connectors and APIs Manual  /  ...  /  Installing Connector/Python from a Binary Distribution

6.4.2 Installing Connector/Python from a Binary Distribution

Installing Connector/Python with pip

Use pip to install and upgrade Connector/Python:

# Installation
$> pip install mysql-connector-python
# Upgrade
$> pip install mysql-connector-python --upgrade
# Optional, installs the X DevAPI interface
$> pip install mysqlx-connector-python

Installing Connector/Python on Microsoft Windows

Use pip; installing Python on Windows also makes pip available from the command line (cmd.exe).

Installing Connector/Python on macOS

Use pip; installing Python on macOS also makes pip available.

Note

DMG installer packages were available before Connector/Python 8.1.0.

Installing Connector/Python on Linux Using the MySQL Yum Repository

EL-based platforms can optionally use RPMs instead of pip, either by using the Connector/Python RPM downloads or by using the MySQL Yum repository (see Installing Additional MySQL Products and Components with Yum and Adding the MySQL Yum Repository).

RPM Prerequisites

  • A python3-protobuf RPM package is not available for Python 3.8 on these platforms, so the dependency is not part of the RPM specification; instead it must be manually installed with the likes of pip install protobuf. This is required as of v8.0.29.

  • The mysql-community-client-plugins package is required to use modern authentication methods, such as caching_sha2_password, which is the default authentication method as of MySQL 8.0.

$> sudo yum install mysql-community-client-plugins

Then install Connector/Python as follows:

$> sudo yum install mysql-connector-python

Installing Connector/Python on Linux Using an RPM Package

Connector/Python Linux RPM packages (.rpm files) are available from the Connector/Python download site (see Section 6.4.1, “Obtaining Connector/Python”).

To install a Connector/Python RPM package (denoted here as PACKAGE.rpm), use this command:

$> rpm -i PACKAGE.rpm

Prerequisites

  • A python3-protobuf RPM package is not available for Python 3.8 on these platforms, so the dependency is not part of the RPM specification; instead it must be manually installed with the likes of pip install protobuf. This is required as of v8.0.29.

  • The mysql-community-client-plugins package is required to use newer authentication methods, such as caching_sha2_password, which is the default authentication method as of MySQL 8.0.

RPM provides a feature to verify the integrity and authenticity of packages before installing them. To learn more, see Verifying Package Integrity Using MD5 Checksums or GnuPG.