• django使用mysql出现警告Warning: (3135, "'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release


    django使用mysql出现警告

    Warning: (3135, "'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.") Warning: (3090, "Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.")

    中文意思是

    警告:(3135,"'NO_ZERO_DATE', 'NO_ZERO_IN_DATE'和' error_for_division on_by_zero ' sql模式应该与严格模式一起使用。它们将在未来的版本中与strict模式合并。”

    警告:(3090,“不建议更改sql模式‘NO_AUTO_CREATE_USER’”。它将在未来的版本中被删除。”

     

    就是说SQL modes应该使用安全模式,即该功能将可能在未来的版本中被舍弃或者合并,这是MySQL向后兼容常见的处理方式

     

    把setting里的options注释掉就正常了

    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.mysql',
            "HOST": '127.0.0.1',
            "PORT": '3306',
            "NAME": "guest",
            "USER": "root",
            "PASSWORD": '',
            # "OPTIONS": {
            #     'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
            # },
        }
    }
  • 相关阅读:
    设计模式面试
    Netty面试
    Nginx面试
    java后端面试
    springboot面试专题及答案
    SpringBoot整合Mybatis,TypeAliases配置失败的问题
    vscode调试html文件
    Linux性能检查命令总结[转]
    如何创建systemd定时任务
    Systemd简介与使用
  • 原文地址:https://www.cnblogs.com/z-x-y/p/11261947.html
Copyright © 2020-2023  润新知