Comparison of Mysqlclient and Pymysql

Source: Internet
Author: User

Environment: Python 3.5+, Django 1.9+

When initially using Django, the search found Pymysql articles a lot, but in the official Django document Python3 version of the MySQL client driver did not mention Pymysql, only referred to Mysqlclient, and then look down to find:

1. The authors of two libraries are the same person Inada Naoki, pip Library mailboxes are all pointing to mailto:[email protected]

2. Pymysql code personnel Methane said mysqlclient faster and Pymysql application Scenarios , see: https://github.com/PyMySQL/PyMySQL/issues/342

Mysqlclient-python is much faster than pymysql.
When to use Pymysql is:

      • You can ' t use libmysqlclient for some reason
      • You want to use monkeypatched socket of gevent or Eventlet
      • You wan ' t to hack MySQL protocol

3. DJANGO1.9.12 Official Documentation:

Django requires Mysqlclient 1.3.3 or later. Note that Python 3.2 is not supported. Except for the Python 3.3+ support,
Mysqlclient should mostly behave the same as MYSQLDB.

4. Https://python.libhunt.com/project/mysqlclient-python/vs/pymysql comparison of the two fundamentals

By contrast, prepare to use mysqlclient! first.

Comparison of Mysqlclient and Pymysql

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.