Da'sBlog

mysql-mysql5.7-[Err]1067-Invaliddefaultvaluefor

升级到mysql5.7后,还原数据出现[Err]1067-Invaliddefaultvaluefor,更改mysqld组的sql_mode.
5.7在/etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld]
#
# * Basic Settings
#
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
sql_mode        = ALLOW_INVALID_DATES

设置完后,查询下,如果是ALLOW_INVALID_DATES说明改成功。否则检查下。

1
2
3
4
5
6
mysql> select @@sql_mode;
+----------------------------------------------------------------+
| @@sql_mode |
+----------------------------------------------------------------+
| STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+----------------------------------------------------------------+

坚持原创技术分享,您的支持将鼓励我继续创作!