diff --git a/apiserver/paasng/paasng/settings/__init__.py b/apiserver/paasng/paasng/settings/__init__.py index 92dceae345..81faefbf2f 100644 --- a/apiserver/paasng/paasng/settings/__init__.py +++ b/apiserver/paasng/paasng/settings/__init__.py @@ -47,6 +47,7 @@ from pathlib import Path from typing import Any, Dict, List, Optional +import pymysql from bkpaas_auth.core.constants import ProviderType from django.contrib import messages from django.utils.encoding import force_bytes, force_str @@ -84,6 +85,10 @@ _notset = object() +pymysql.install_as_MySQLdb() +# Patch version info to forcely pass Django client check +setattr(pymysql, "version_info", (1, 4, 2, "final", 0)) + # 蓝鲸数据库内容加密私钥 # 使用 `from cryptography.fernet import Fernet; Fernet.generate_key()` 生成随机秘钥 # 详情查看:https://cryptography.io/en/latest/fernet/