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的更多相关文章

  1. windows10 -- mysql5.5 + python3.4 + django1.11 +pycharm2016.2 + PyMySQL(DB DRIVER) 环境搭建

    环境介绍 2016-07-2513:32:26 name value comment OS win10 操作系统 python python3.4 python主程序 IDE pycharm:  20 ...

  2. python3 django1.11 安装xadmin 的方法,亲测可用

    首先需要Pip安装如下的包ip install django-crispy-forms pip install django-import-export pip install django-reve ...

  3. Python3.7&Django1.11.15 兼容性问题

    环境: 1. Windows10 2. python3.7 3. Django1.11.15 启动Django时抛出以下异常: Unhandled exception in thread starte ...

  4. python3.7环境下创建app、运行Django1.11版本项目报错Generator expression must be parenthesized

    有些同学喜欢追求新鲜感~但追求新鲜感终归是要付出一点点代价的 在编程领域有一句至理名言:用东西不要用最新的! 就像每次苹果系统的升级都会有相当一部分用户的手机成砖一样 下面我们就介绍一个因版本升级带来 ...

  5. python3.7环境下创建app,运行Django1.11版本项目报错SyntaxError: Generator expression must be parenthesized

    咳咳!!! 今天用命令行创建django项目中的app应用,出现了这样一个错误 这个错误在python3.6版本下安装运行django 1.11版本正常运行,但python3.7版本下运行django ...

  6. django1.11版本在python3.7中运行还有点兼容性问题.

    django1.11版本在python3.7中运行还有点兼容性问题. 出现SyntaxError: Generator expression must be parenthesized这个报错 找到这 ...

  7. Windows下Python3.6.2+Django-1.11.5+httpd-2.4.27-win64-VC14部署网站

    最近项目组正在上python+django.现在将部署过程总结下,相关文件也备份下,面得每次都要弄半天.网上很多不靠谱的做法,让我反复试错,浪费不少时间. 原材料: Python3.6.2 httpd ...

  8. PHP数据库操作:从MySQL原生API到PDO

    本文将举详细例子向大家展示PHP是如何使用MySQL原生API.MySQLi面向过程.MySQLi面向对象.PDO操作MySQL数据库的. 为了后面的测试,先建立数据库表test.包含表名user,s ...

  9. The MySQL C API 编程实例

    在网上找了一些MYSQL C API编程的文章,看了后认为还是写的不够充分,依据自己经验写了这篇<The MySQL C API 编程实例>,希望对须要调用到MYSQL的C的API的朋友有 ...

随机推荐

  1. Linux系统SCSI磁盘扫描机制解析及命令实例(转)

    转载请在文首保留原文出处:EMC中文支持论坛 介绍 Linux系统扫描SCSI磁盘有几种方式?Linux新增LUN之后,能否不重启主机就认出设备?如果安装了PowerPath,动态添加/删除LUN的命 ...

  2. stm32中断 抢占优先级 和 响应优先级 有什么区别

    与51不同,stm32的中断分类更灵活.51只是按先后顺序大小排列互相打断. stm32中多了响应优先级这一概念. stm32的中断分为 1.抢占(占先)优先级. 2.响应优先级. 1.抢占优先级.抢 ...

  3. leetcode682

    class Solution { public: int calPoints(vector<string>& ops) { stack<int> ST; ; for ( ...

  4. Navigator - BOM对象

    Navigator 对象 Navigator 对象包含有关浏览器的信息. 注释:没有应用于 navigator 对象的公开标准,不过所有浏览器都支持该对象. Navigator 对象集合 集合 描述 ...

  5. CAD2015 安装出错

    Autodesk安装失败后回滚连带把在D盘创建的安装目录都给删除掉了. 把.net 4.6卸载干净之后就可以成功安装CAD2015了.只安装.net 4.5就行了.

  6. codeforce468DIV2——D. Peculiar apple-tree

    题意给你一颗树,开始时每个结点都有一个小球,每一秒钟每个小球都往上滚一层,当两个球在同一个结点的时候会被消去,如果三个五个七个等在同一个结点的化消去后只剩一个. 分析 这对我来说就TM是英语阅读理解哇 ...

  7. golang hello

    package main import "fmt" func main() { fmt.Printf("Hello, world.\n") }

  8. JSTL标签之core标签的使用

    参考:http://blog.csdn.net/qq_25827845/article/details/53311722 核心标签库的导入 <%@ taglib prefix="c&q ...

  9. bzoj5392 [Lydsy1806月赛]路径统计

    传送门 分析 我们设sum[x]为小于等于x的点现在有多少联通 于是一个序列合法当且只当sum[R]-sum[L-1]=len且所有点度数不大于2 我们知道如果对于序列[L,R]满足条件则[L+1,R ...

  10. 专题2-通过按键玩中断\第1课-中断处理流程深度剖析-lesson1

    中断概念 1.中断生命周期 串口先产生一个事件,该事件传送到中断控制器里面,中断控制器会进行相应过滤,能通过过滤,那么就交给CPU去处理. 2.中断源 2440芯片手册 6410芯片手册 3.中断过滤 ...