4.2 Installing Connector/Python from a Binary Distribution

Connector/Python installers in native package formats are available for Windows and for Unix and Unix-like systems:

You may need root or administrator privileges to perform the installation operation.

As of Connector/Python 2.1.1, binary distributions are available that include a C Extension that interfaces with the MySQL C client library. Some packaging types have a single distribution file that includes the pure-Python Connector/Python code together with the C Extension. (Windows MSI and OS X Disk Image packages fall into this category.) Other packaging types have two related distribution files: One that includes the pure-Python Connector/Python code, and one that includes only the C Extension. For packaging types that have separate distribution files, install both distributions if you want to use the C Extension. The two files have related names, the difference being that the one that contains the C Extension has cext in the distribution file name.

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

Installing Connector/Python on Microsoft Windows Using an MSI Package

Connector/Python Windows MSI Installers (.msi files) are available from the Connector/Python download site (see Section 4.1, “Obtaining Connector/Python”). Choose an installer appropriate for the version of Python installed on your system. As of Connector/Python 2.1.1, MSI Installers include the C Extension; it need not be installed separately.

To use the MSI Installer, launch it and follow the prompts in the screens it presents to install Connector/Python in the location of your choosing.

Alternatively, to run the installer from the command line, use this command in a console window, where VER and PYVER are the respective Connector/Python and Python version numbers in the installer file name:

shell> msiexec /i mysql-connector-python-VER-pyPYVER.msi

Subsequent executions of Connector/Python using the MSI installer permit you to either repair or remove the existing Connector/Python installation.

Installing Connector/Python on Linux Using the MySQL Yum Repository

For EL6 or EL7-based platforms and Fedora 19 or 20, 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:

shell> sudo yum update mysql-community-release

Then install Connector/Python as follows:

shell> 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:

shell> rpm -i PACKAGE.rpm

To install the C Extension (available as of Connector/Python 2.1.1), install the corresponding package with cext in the package 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”).

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

shell> dpkg -i PACKAGE.deb

To install the C Extension (available as of Connector/Python 2.1.1), install the corresponding package with cext in the package name.

Installing Connector/Python on OS X Using a Disk Image

Connector/Python OS X disk images (.dmg files) are available from the Connector/Python download site (see Section 4.1, “Obtaining Connector/Python”). As of Connector/Python 2.1.1, OS X disk images include the C Extension; it need not be installed separately.

Download the .dmg file and install Connector/Python by opening it and double clicking the resulting .pkg file.