Install MariaDB Connector/Python

Overview

MariaDB Connector/Python can be installed in multiple ways.

Dependencies

MariaDB Connector/Python has the following dependencies:

Version

Installation Methods

Connector/C Dependency

Python 3 Dependency

Connector/Python 1.1

  • MSI (Microsoft Windows)

  • Required: None (Connector/C 3.3 is included)

  • Required: CPython 3.7 or later

Connector/Python 1.1

  • pip3 (from PyPI)

  • pip3 (from source tarball)

  • Recommended: Connector/C 3.3.0 or later

  • Required: Connector/C 3.2.4 or later

  • Required: CPython 3.7 or later

Connector/Python 1.0

  • pip3 (from PyPI)

  • pip3 (from source tarball)

  • Required: Connector/C 3.1.5 or later

  • Required: CPython 3.7 or later

Install from PyPI

  1. Install MariaDB Connector/C, which is a dependency.

  2. Use pip3 to install MariaDB Connector/Python through PyPI.

    To install the latest MariaDB Connector/Python 1.1 release from PyPI:

    $ pip3 install mariadb==1.1.4
    

    To install the latest MariaDB Connector/Python 1.0 release from PyPI:

    $ pip3 install mariadb==1.0.11
    

Install from Source

  1. Install MariaDB Connector/C, which is a dependency.

  2. Go to the MariaDB Downloads page

  3. Download a source tarball for a supported MariaDB Connector/Python 1.1 or MariaDB Connector/Python 1.0 release.

  4. Extract the source tarball.

    To extract the source tarball for the latest MariaDB Connector/Python 1.1 release:

    $ mkdir mariadb-connector-python
    $ cd mariadb-connector-python
    $ tar -xvzf ../mariadb-connector-python-1.1.4.tar.gz
    

    To extract the source tarball for the latest MariaDB Connector/Python 1.0 release:

    $ mkdir mariadb-connector-python
    $ cd mariadb-connector-python
    $ tar -xvzf ../mariadb-connector-python-1.0.11.tar.gz
    
  5. Use pip3 to install from the source code.

    To install a MariaDB Connector/Python 1.1 or MariaDB Connector/Python 1.0 release from source:

    $ pip3 install ./mariadb-*
    

Install via MSI (Windows)

Starting with MariaDB Connector/Python 1.1, an MSI package is available for installations on Microsoft Windows:

  1. Go to the MariaDB Downloads page

  2. Ensure the "Product" dropdown reads "Python connector".

  3. In the "Version" dropdown, select the version you want to download.

  4. In the "OS" dropdown, select either "MS Windows (64-bit)" or "MS Windows (32-bit)", depending on whether you need a 64-bit or 32-bit connector.

  5. Click on the "Download" button to download the MSI package.

  6. When the MSI package finishes downloading, run it and follow the on-screen instructions.