File: installation.rst

package info (click to toggle)
mysql-connector-python 9.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 27,768 kB
  • sloc: python: 83,598; sql: 47,030; ansic: 3,494; cpp: 860; sh: 394; makefile: 208; javascript: 2
file content (80 lines) | stat: -rw-r--r-- 3,043 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Installation
------------

Packages are available at the `Connector/Python download site <http://dev.mysql.com/downloads/connector/python/>`_. For some packaging formats, there are different packages for different versions of Python; choose the one appropriate for the version of Python installed on your system.

Installing Connector/Python with pip
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This is the recommended way to install Connector/Python.

Make sure you have a recent `pip <https://pip.pypa.io/>`_ version installed on your system. If your system already has ``pip`` installed, you might need to update it. Or you can use the `standalone pip installer <https://pip.pypa.io/en/latest/installing/#installing-with-get-pip-py>`_.

.. code-block:: bash

    shell> pip install mysqlx-connector-python

Installing Connector/Python on Linux Using the MySQL Yum Repository
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You must have the MySQL Yum repository on your system's repository list. To make sure that your Yum repository is up-to-date, use this command:

.. code-block:: bash

    shell> sudo yum update mysql-community-release

Then install Connector/Python as follows:

.. code-block:: bash

    shell> sudo yum install mysqlx-connector-python

Installing Connector/Python on Linux Using an RPM Package
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

.. code-block:: bash

    shell> rpm -i PACKAGE.rpm

Installing Connector/Python on Linux Using a Debian Package
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

.. code-block:: bash

    shell> dpkg -i PACKAGE.deb

Installing Connector/Python from source
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Prerequisites
~~~~~~~~~~~~~

As of Connector/Python 2.2.3, source distributions include a C++ Extension, that interfaces with a MySQL server with the X Plugin enabled using Protobuf as data interchange format.

To build Connector/Python C++ Extension for Protobuf, you must satisfy the following prerequisites:

* A C/C++ compiler, such as ``gcc``
* Protobuf C++ (version 5.29.4)
* Python development files
* MySQL Connector/C or MySQL Server installed

Installing Connector/Python from source on Unix and Unix-Like Systems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To install Connector/Python from a tar archive, download the latest version (denoted here as <version>), and execute these commands:

.. code-block:: bash

   shell> tar xzf mysqlx-connector-python-<version>.tar.gz
   shell> cd mysqlx-connector-python-<version>.tar.gz
   shell> python setup.py install --with-protobuf-include-dir=<protobuf-include-dir> --with-protobuf-lib-dir=<protobuf-lib-dir> --with-protoc=<protoc-binary>

To see all options and commands supported by setup.py, use this command:

.. code-block:: bash

   shell> python setup.py --help