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. Autofac 4 netcore with config demo

    Autofac 4+以上和以前的配置不一样的,最近在NetCore中做项目,得到实例时折腾了一番. 使用场景,用autofac实例化数据库类型,避免一个个的去new json配置文件: <?xm ...

  2. python中shuffleSplit()函数

    参数: n : int 数据集中的元素总数. n_iter : int (default 10) 重新洗牌和分裂迭代次数. test_size : float (default 0.1), int, ...

  3. UNIX 网络编程学习

    a.述 书买很久了,好好学习下.O(∩_∩)O  只写程序,原理什么的,先不写了. b.环境 deepin15.4.1 64位 vs code gcc version 6.4.0 20170724 ( ...

  4. codeforce465DIV2——D. Fafa and Ancient Alphabet

    概率的计算答案给出的这张图很清楚了,然后因为要求取模,a/b%M=a*b^-1%M=a*inv(b,M)%M; #include <cstdio> #include <cstring ...

  5. 数据预处理:PCA,SVD,whitening,normalization

    数据预处理是为了让算法有更好的表现,whitening.PCA.SVD都是预处理的方式: whitening的目标是让特征向量中的特征之间不相关,PCA的目标是降低特征向量的维度,SVD的目标是提高稀 ...

  6. CSS 伪类与伪元素

    CSS的元素选择器除了根据id(#).class(.).属性([ ])选取元素以外,还有很重要的一类,就是根据元素的特殊状态来选取元素.它们就是伪类和伪元素.跟id选择器.类选择器.属性选择器以及派生 ...

  7. 把dataTable表批量的写入数据库

    connectionStr:链接字符串:dataTableName数据库中的表:sourceDataTable dataTable的名称 public static void SqlBulkCopyB ...

  8. volatile和 锁的区别

    Volatile: 当把变量声明为volatile类型后,编译器和运行时都会注意到这个变量是共享的,因此不会将该变量上的操作与其它内存操作一起重排序.volatile变量不会被缓存在寄存器或者对其他处 ...

  9. vim 添加插件

    vim 的功能可以通过向它添加plugin得以扩展.所谓的plugin不过是一个vim会自动载入执行的脚本.把一个脚本放到你的plugin目录就可以了,非常容易. plugin基本上分为两类:  全局 ...

  10. Python04 range()方法的使用、turtle.textinput()方法和write()的使用、turtle.numinput()的使用

    1 range() 方法的使用 1.1 range方法介绍 range方法会返回一个range类型的对象,该对象会根据range方法的参数产生一些列整型数据 技巧01:range方法有三个参数,第一个 ...