亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何解決mysql連接錯誤

如何解決mysql連接錯誤

蕪湖不蕪 2023-10-18 20:46:26
我嘗試連接我的數據庫。檢查 settings.py 中的所有數據庫設置并且它們是正確的。當我運行服務器時,我遇到如下所示的錯誤。我在互聯網上搜索并找到了解決方案,但所有這些都適用于較低的 python 版本。我正在使用最新的 python 版本。我的錯誤是:System check identified no issues (0 silenced).Exception in thread django-main-thread:Traceback (most recent call last):File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 917, in _bootstrap_innerself.run()File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 865, in runself._target(*self._args, **self._kwargs)File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/utils/autoreload.py", line 54, in wrapperfn(*args, **kwargs)File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 120, in inner_runself.check_migrations()File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/management/base.py", line 453, in check_migrationsexecutor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/migrations/executor.py", line 18, in __init__self.loader = MigrationLoader(self.connection)File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/migrations/loader.py", line 49, in __init__self.build_graph()File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/migrations/loader.py", line 212, in build_graphself.applied_migrations = recorder.applied_migrations()
查看完整描述

1 回答

?
翻翻過去那場雪

TA貢獻2065條經驗 獲得超14個贊

這是關于以前版本的 django 的老問題。目前是3.1.2,導致問題的代碼塊已修復。

https://github.com/django/django/blob/master/django/db/backends/mysql/operations.py

pip install -U django如果你的 django 版本比 3.0.0 更新,你可以嘗試一下 (好)

其他選擇是在 virtualenv 中的相關行更改 django 版本源代碼(丑陋),或者猴子修補相關功能(不好)


查看完整回答
反對 回復 2023-10-18
  • 1 回答
  • 0 關注
  • 155 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號