Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the differences between mysql-connector-python, mysql-connector-python-rf and mysql-connector-repackaged?

I'd like to use the mysql-connector library for python 3. I could use pymysql instead, but mysql-connector already has a connection pool implementation, while pymysql doesn't seem to have one. So this would be less code for me to write.

However, when I do

$ pip3 search mysql-connector 

I find that these 3 libraries are available:

mysql-connector-repackaged     - MySQL driver written in Python mysql-connector-python-rf      - MySQL driver written in Python mysql-connector-python         - MySQL driver written in Python 

This is very confusing. Anybody knows which one I should use and why?

Thanks for your help.

like image 972
John Smith Optional Avatar asked Dec 09 '15 00:12

John Smith Optional


People also ask

What is difference between MySQL and MySQL connector?

mysqlclient is a forked version of MySQLdb with python3. 3+ support, and mysql connector is official module from mysql.

Which connector connects MySQL to Python?

Python needs a MySQL driver to access the MySQL database. In this tutorial we will use the driver "MySQL Connector". We recommend that you use PIP to install "MySQL Connector". PIP is most likely already installed in your Python environment.

What is the difference between PyMySQL and MySQL?

PyMySQL and MySQLdb provide the same functionality - they are both database connectors. The difference is in the implementation where MySQLdb is a C extension and PyMySQL is pure Python. There are a few reasons to try PyMySQL: it might be easier to get running on some systems.

What does MySQL connector Connect do?

connect() Method. This method sets up a connection, establishing a session with the MySQL server. If no arguments are given, it uses the already configured or default values.


2 Answers

The main differences between them are:

  • mysql-connector-repackaged: is old, do not use it

  • mysql-connector-python 2.0.4: is the original uploaded by MySQL. But it has the problem that does not works with Django >= 1.8. MySQL did not upload yet their stable version 2.1.3 to this repo.

  • mysql-connector-python-rf 2.1.3: is the solution to all your problems if you use Django >= 1.8

like image 95
KGs Avatar answered Sep 23 '22 06:09

KGs


I was just asking myself similar question and I think I found the "fresh" answer. Here is info from two weeks ago: https://github.com/pypa/warehouse/issues/5537

It seems that currently a long-inactive person is owner of the mysql-connector name, hence MySQL developers release under name mysql-connector-python.

like image 31
bez imienny Avatar answered Sep 23 '22 06:09

bez imienny