?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default'
2017-02-15 14:48
836 查看
问题
django项目中,执行python manage migrate时
WARNINGS: ?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default' HINT: MySQL's Strict Mode fixes many data integrity problems in MySQL, such as data truncation upon insertion, by escalating warnings into errors. It is strongly recommended you activate it. See: https://docs.djangoproject.com/en/1.10/ref/databases/#mysql-sql-mode[/code]解决
在settings中,在DATABASES变量定义处下面添加DATABASES['OPTIONS']['init_command'] = "SET sql_mode='STRICT_TRANS_TABLES'"
或者在DATABASES变量定义时,添加上面命令中所示的键值对。
相关文章推荐
- MYSQL:Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'
- 删除sybase一列报错:The 'select into' database option is not enabled for database.....
- Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: socket creation error
- The method setClass(Context, Class<?>) in the type Intent is not applicable for the arguments (GameV
- adstpall.sh: Database connection could not be established. Either the database is down or the APPS c
- Host 'xxx.xx.xx-xx.xx.com' is not allowed to connect to this MySQL serverConnection closed by foreig
- VS2005 出现 The OutputPath property is not set for this project. 错误的解决方法
- The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility is enabled for this application. Turn off ASP.NET compatibility mode in the web.config or add the AspNetCompatibilityRequirements attribute to the ser
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- 问题解决[<UIViewController 0x8430220>setValue:forUndefinedKey:]this class is not key value..
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum
- Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key
- Jira的 Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'错误的解决
- The method setClass(Context, Class<?>) in the type Intent is not applicable for the arguments (GameV
- VS2005智能设备项目的Bug:"The OutputPath property is not set for this project..."
- MPI编译C++程序出现#error "SEEK_SET is #defined but must not be for the C++ binding of MPI" 的解决方法
- QSqlDatabasePrivate::removeDatabase: connection 'qt_sql_default_connection' is still in use
- database connection pool for mysql
- ORA-39921: Default Partition (Table) Tablespace USERS for TP not contained in transportable set
- The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the argum