python3+django1.11+mysql5.7 MySQL DB API Drivers

Source: Internet
Author: User
Tags connection pooling mysql client

The Python Database API is described in PEP 249. MySQL has three prominent drivers that implement the This API:

    • MySQLdb is a native driver it has been developed and supported for over a decade by Andy Dustman.
    • Mysqlclient is a fork in MySQLdb which notably supports Python 3 and can be used as a drop-in replacement for MYSQLDB. At the time of this writing, this is the recommended choice for using MySQL with Django.
    • MySQL Connector/python is a pure Python driver from Oracle This does not require the MySQL client library or any Python mo Dules outside the standard library.

All these drivers is thread-safe and provide connection pooling. Is the-one not MySQLdb supporting Python 3 currently.

In addition to a DB API driver, Django needs an adapter to access the database drivers from its ORM. Django provides an adapter for mysqldb/mysqlclient while MySQL Connector/python includes its own.

Mysqlclient

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.

python3+django1.11+mysql5.7 MySQL DB API Drivers

Related Article

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.