django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3
2020-02-02 23:46
826 查看
代码运行环境说明:
Python:3.7.4 Django:2.2.6 PyMySQL:0.9.3
执行数据库迁移时输入命令:python manage.py makemigrations出现以下提示:
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.
网上查资料发现解决方法有三种:
- 将你的Django降低到2.14以下;
- 升级的mysql客户端版本至更高 ;
- 按照以下步骤修改代码:
将base.py中
修改为:
继续输入命令:python manage.py migrate如果出现以下情况:
File "D:\Program Files\Python37\lib\site-packages\django\db\backends\mysql\operations.py", line 146, in last_executed_query query = query.decode(errors='replace') AttributeError: 'str' object has no attribute 'decode'
将operations.py中的
修改为:
继续执行命令:python manage.py migrate如果出现以下情况:
django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the django_migrations table ((1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ver sion for the right syntax to use near '(6) NOT NULL)' at line 1"))
这个是因为Django2.1不再支持MySQL5.5,必须5.6版本以上
解决办法:将MySQL升级
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3
- django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3
- django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.
- win10 下 django2.2生成mysql数据迁移文件出错(mysqlclient 1.3.13 or newer is required; you have 0.9.3)解决方法
- Django中使用mysqlclent服务报错:mysqlclient 1.3.13 or newer is required; you have 0.9.3.
- django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11
- Django将数据库切换为Mysql及mysqlclient 1.3.13 or newer is required; you have 0.9.2报错解决方案
- ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3. 解决办法
- Django连接mysql django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required;
- macOS使用django安装mysqlclient遇到的问题(mysqlclient 1.3.3 or newer is required)
- 解决 Django 的 if version (1, 3, 3): raise ImproperlyConfigured("mysqlclient 1.3.3 or newer is requi
- Caused by: com.mysql.cj.exceptions.UnableToConnectException: CLIENT_PLUGIN_AUTH is required
- Hue 安装问题django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: libmysqlclient.so
- 解决mysql 添加插件时提示 ERROR 1289 (HY000): The ‘plugin’ feature is disabled; you need MySQL built with ‘HAVE_DLOPEN&#
- The template you have chosen is invalid or cannot be found.
- sqlserver2008R2 is not a valid login or you do have permission
- 安装SQL Server 2008 R2 Enterprise错误:'' is not a valid login or you do not have permission
- XAMPP里tomcat启动报错:Make sure you have Java JDK or JRE installed and the required ports are free
- Error:MySQLdb Module 'Did you install mysqlclient or MySQL-python?
- 解决#1289 - The \'InnoDB\' feature is disabled; you need MySQL built with \'InnoDB\' to have it working的问题