def METHOD_NAME(request):
    """创建数据库"""
    instance_id = request.POST.get("instance_id", 0)
    db_name = request.POST.get("db_name")
    owner = request.POST.get("owner", "")
    remark = request.POST.get("remark", "")
    if not all([db_name]):
        return JsonResponse({"status": 1, "msg": "参数不完整，请确认后提交", "data": []})
    try:
        instance = user_instances(request.user, db_type=["mysql", "mongo"]).get(
            id=instance_id
        )
    except Instance.DoesNotExist:
        return JsonResponse({"status": 1, "msg": "你所在组未关联该实例", "data": []})
    try:
        owner_display = Users.objects.get(username=owner).display
    except Users.DoesNotExist:
        return JsonResponse({"status": 1, "msg": "负责人不存在", "data": []})
    engine = get_engine(instance=instance)
    if instance.db_type == "mysql":
        # escape
        db_name = engine.escape_string(db_name)
        exec_result = engine.execute(
            db_name="information_schema", sql=f"create database {db_name};"
        )
    elif instance.db_type == "mongo":
        exec_result = ResultSet()
        try:
            conn = engine.get_connection()
            db = conn[db_name]
            db.create_collection(
                name=f"archery-{db_name}"
            )  # mongo创建数据库，需要数据库存在数据才会显示数据库名称，这里创建一个archery-{db_name}的集合
        except Exception as e:
            exec_result.error = f"创建数据库失败, 错误信息：{str(e)}"
    # 关闭连接
    engine.close()
    if exec_result.error:
        return JsonResponse({"status": 1, "msg": exec_result.error})
    # 保存到数据库
    else:
        InstanceDatabase.objects.METHOD_NAME(
            instance=instance,
            db_name=db_name,
            owner=owner,
            owner_display=owner_display,
            remark=remark,
        )
        # 清空实例资源缓存
        r = get_redis_connection("default")
        for key in r.scan_iter(match="*insRes*", count=2000):
            r.delete(key)
    return JsonResponse({"status": 0, "msg": "", "data": []})