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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python3+Django1.11+mysql5.7 MySQL DB API Drivers相关的知识,希望对你有一定的参考价值。

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

  • MySQLdb is a native driver that has been developed and supported for over a decade by Andy Dustman.
  • mysqlclient is a fork of 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 that does not require the MySQL client library or any Python modules outside the standard library.

All these drivers are thread-safe and provide connection pooling. MySQLdb is the only one not 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的主要内容,如果未能解决你的问题,请参考以下文章

VScode 搭建 django 开发环境(Win Python3.71 django1.11.11)

基于Django1.11和Python3开发一个简单的投票系统

python3使用django1.11不支持MYSQL-python的解决办法

在Centos6.8上为安装Django1.11.1升级Python2.6到Python3.5

win10 64位 python3.6 django1.11 MysqlDB No module named 'MySQLdb' 安装MysqlDB报错 Microsoft Visua

升级到 Django 1.11 后 append_slash 不再起作用