zoukankan      html  css  js  c++  java
  • 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'",
            # },
        }
    }
  • 相关阅读:
    使用iframe从网页调起移动端应用
    综合练习:词频统计
    组合数据类型练习
    python 绘制五星红旗
    熟悉常用的Linux操作
    大数据概述
    windowBackground打造闪屏页
    安卓日期选择对话框
    c语言语法分析器
    C语言文法
  • 原文地址:https://www.cnblogs.com/z-x-y/p/11261947.html
Copyright © 2011-2022 走看看