MySQL Connector/Python Developer Guide  /  Connector/Python Installation  /  Installing Connector/Python from a Binary Distribution

4.2 Installing Connector/Python from a Binary Distribution

Connector/Python installers in native package formats are available for most Unix-based systems, but not for macOS or Windows.

Note

Prior to Connector/Python 8.0.22, the C extension and pure Python implementations were installed using two separate binary distributions; except they were always combined for Windows and macOS. The C extension implementation had cext in the package name.

Binary distributions that provide the C Extension link to an already installed C client library provided by a MySQL Server installation. For those distributions that are not statically linked, you must install MySQL Server if it is not already present on your system. To obtain it, visit the MySQL download site.

Installing Connector/Python with pip

Use pip to install Connector/Python on most any operating system:

$> pip install mysql-connector-python

Installing Connector/Python on Microsoft Windows

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

Note

MSI installer packages were available before Connector/Python 8.1.0.

Installing Connector/Python on Linux Using the MySQL Yum Repository

For EL7 or EL8-based platforms and Fedora, you can install Connector/Python using the MySQL Yum repository (see Installing Additional MySQL Products and Components with Yum). You must have the MySQL Yum repository on your system's repository list (for details, see Adding the MySQL Yum Repository). To make sure that your Yum repository is up-to-date, use this command:

$> sudo yum update mysql-community-release

Prerequisites

  • On EL7, EL8, and SUSE: 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.

  • Although optional, the mysql-community-client-plugins package is required to use newer authentication methods, such as caching_sha2_password that's 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 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

  • On EL7, EL8, and SUSE: 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.

  • Although optional, the mysql-community-client-plugins package is required to use newer authentication methods, such as caching_sha2_password that's the default authentication method as of MySQL 8.0.

Note

Prior to Connector/Python 8.0.22, the C extension implementation was a separate RPM package that contained cext in the name.

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.

Installing Connector/Python on Linux Using a Debian Package

Connector/Python Debian packages (.deb files) are available for Debian or Debian-like Linux systems from the Connector/Python download site (see Section 4.1, “Obtaining Connector/Python”).

Prerequisite.  Although optional, the mysql-community-client-plugins package is required to use newer authentication methods, such as caching_sha2_password that's the default authentication method as of MySQL 8.0.

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

$> dpkg -i PACKAGE.deb
Note

Prior to Connector/Python 8.0.22, the C extension implementation was a separate DEB package that contained cext in the name.

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.