django4.1.3及以上的版本提示“django.db.utils.NotSupportedError: MySQL 5.7 or later is required”的解决办法

作者在 2022-11-17 03:15:00 发布以下内容
网站升级到 django4.1.3 后,连接老版本的数据库(mysql5.5)的时候,时不时出现错误:
  File "/usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py", line 207, in check_database_version_supported
    raise NotSupportedError(
django.db.utils.NotSupportedError: MySQL 5.7 or later is required (found 5.5.53).
解决办法:
vi /usr/local/lib/python3.11/site-packages/django/db/backends/base/base.py
搜索“self.check_database_version_supported”,然后把这一行注释掉。
Python | 阅读 2510 次
文章评论,共3条
儒常层营(游客)
2022-11-17 16:24
1
好巧,作者半夜发的文章刚好解决了第二天我遇到的问题,感想
实湿关苏(游客)
2023-01-12 13:27
2
在执行python manage.py migrate的时候也报了Django和Mysql版本不兼容,该怎么解决啊
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 version for the right syntax to use near '(6) NOT NULL)' at line 1"))
破今种利(游客)
2023-02-07 09:58
3
牛的
游客请输入验证码
浏览2617267次
文章归档
最新评论