搭建Django2.0+Python3+MySQL5时同步数据库时报错:
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11.None
解决办法:
找到Python安装路劲下的Python36-32\Lib\site-packages\django\db\backends\mysql\base.py文件
将文件中的如下代码注释
if version < (1, 3, 3):
    raise ImproperlyConfigured("mysqlclient 1.3.3 or newer is required; you have %s" % Database.__version__)
重新在项目manage.py路劲下执行如下命令即可
python manage.py makemigrations
python manage.py migrate
附:Django配置MySQL数据库方法
一、settings.py文件中修改数据库配置为下面的内容:
# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'HOST': '127.0.0.1',
        'PORT': '3306',
        'NAME': 'mysql',
        'USER': 'root',
        'PASSWORD': 'zwg123456',
        'OPTIONS': {
            'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
            },
    }
}
驱动(ENGINE)、主机地址(HOST)、端口号(PORT)、数据库(NAME)、用户名(NAME)以及登录密码(PASSWORD);
二、在__init_.py文件添加如下配置:
# coding=utf-8
import pymysql
pymysql.install_as_MySQLdb()
因为Django连接MySQL时默认使用MySQLdb驱动,但MySQLdb不支持Python3,因此这里将MySQL驱动设置为pymysql。
三、执行数据迁移
在项目manage.py路劲下执行如下命令即可
python manage.py makemigrations
python manage.py migrate
关于sql_mode的设置,可参考Django文档:https://docs.djangoproject.com/en/2.0/ref/databases/#setting-sql-mode
 ————————————————
版权声明:本文为CSDN博主「潜行100」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_35304570/article/details/79674449

django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11的更多相关文章

  1. Django2.2连接mysql数据库出现django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11.None问题

    在使用Django2.2开发的时候,想要使用mysql数据库,在settings.py文件中更改命令: DATABASES = { 'default': { 'ENGINE': 'django.db. ...

  2. Django2.2报错 django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.

    准备将 Django 连接到 MySQL,在命令行输入命令 python manage.py makemigrations 后报错: django.core.exceptions.Improperly ...

  3. django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.2的最佳处理方法,亲测可用

    django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.2 ...

  4. django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.解决办法

    "E:\API_Manager_PlatForm\venv\lib\site-packages\django\db\backends\mysql\base.py"在这个路径里件把b ...

  5. django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.

    异常汇总:https://www.cnblogs.com/dotnetcrazy/p/9192089.html 这个是Django对MySQLdb版本的限制,我们使用的是PyMySQL,所以不用管它 ...

  6. Django生成脚本迁移文件时,报错django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.

    一.本人环境:django:3.0.2, python:3.8.1,  pymysql:0.9.3 二.解决步骤: 1.django目录下找到 base.py文件: 2.在base.py文件中注释以下 ...

  7. exceptions: django2.2/ mysql ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3

    在centos部署python应用后访问页面,显示如下异常信息 报错环境 python=3.6,django=2.2……django.core.exceptions.ImproperlyConfigu ...

  8. django2.2/mysql ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3

      报错环境 python=3.6.5,django=2.2,PyMySQL=0.9.3 …… django.core.exceptions.ImproperlyConfigured: mysqlcl ...

  9. 【Django】django.core.exceptions.ImproperlyConfigured: mysqlclient 1.4.0 or newer is required;

    报错信息 django.core.exceptions.ImproperlyConfigured: mysqlclient 1.4.0 or newer is required; you have 0 ...

随机推荐

  1. macOS 10.15 Catalina Apache设置:多个PHP版本

    第1部分:macOS 10.15 Catalina Web开发环境 在macOS上开发Web应用程序真是令人高兴.有许多设置开发环境的选项,包括广受欢迎的MAMP Pro,它在Apache,PHP和M ...

  2. 我们打开Podfile修改一下,以便将flutter包括在里面

    platform :ios, '9.0'target 'myproject' do end #新添加的代码flutter_application_path = '../'eval(File.read( ...

  3. 如何把vue.js项目部署到服务器上

    如何把vue.js项目部署到服务器上面,我用的是tomcat服务器 1-改一下config/index.js文件,如下图,把assetsPublicPath: './', productionSour ...

  4. HDU6669 Game(思维,贪心)

    HDU6669 Game 维护区间 \([l,r]\) 为完成前 \(i\) 步使用最少步数后可能落在的区间. 初始时区间 \([l,r]\) 为整个坐标轴. 对于第 \(i\) 个任务区间 \([a ...

  5. P2258子矩阵

    传送 一道看起来就很暴力的题. 这道题不仅暴力,还要用正确的姿势打开暴力. 因为子矩阵的参数有两个,一个行一个列(废话) 我们一次枚举两个参数很容易乱对不对?所以我们先枚举行,再枚举列 枚举完行,列, ...

  6. .Net-WCF-图书:《WCF编程》

    ylbtech-.Net-WCF-图书:<WCF编程> <WCF编程>是2008年1月机械工业出版社出版的图书,作者是Juval Lowy.Clemens Vasters. 1 ...

  7. python实现压缩文件成zip格式

    实现代码如下: #压缩文件 import time,zipfile class zip: def get_zip(self,files,zip_name): zp=zipfile.ZipFile(zi ...

  8. 【ABAP系列】SAP ABAP 工单增强

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP 工单增强   ...

  9. 【ABAP系列】SAP ABAP基础-SQL的嵌套使用

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP基础-SQL的嵌 ...

  10. 关于在eclipse中配置tomcat的各种坑

    先说在windows下的,java环境什么的就不再记录了,记住装java ee之前,先要装好java se这样java ee才能顺利安装. 主要是安装好tomcat之后,在eclipse中进行配置的时 ...