用mysqldump导出的数据文件,再用source导进去的时候常常有一些报错 ariable sql_mode cant be set to the value of NULL,百度了好几回,终于找到是mysql导出的注释语句问题,导出的文件常常如下:
- /*!40101SETSQL_MODE=@OLD_SQL_MODE*/;
- /*!40014SETFOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS*/;
- /*!40014SETUNIQUE_CHECKS=@OLD_UNIQUE_CHECKS*/;
- /*!40101SETCHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT*/;
- /*!40101SETCHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS*/;
- /*!40101SETCOLLATION_CONNECTION=@OLD_COLLATION_CONNECTION*/;
- /*!40111SETSQL_NOTES=@OLD_SQL_NOTES*/;
解决方法:删除注释语句后再执行批量SQL语句操作.
利用二进制日志恢复报错?Variable 'sql_mode' can't be set to the value of '1344274432'.
- Serverversion5.0.18-log
- Protocolversion10
- ConnectionlocalhostviaTCP/IP
操作系统:windowsXp,mysql为InnoDB存储引擎,数据库为utf.
win.ini中配置,代码如下:
- [mysql]
- default-character-set=utf8
- [mysqld]
- basedir="c:/MySQL5/"
- datadir="c:/MySQL5/Data/"
- log-bin="d:/log/log"
- binlog-do-db=test
- innodb_data_home_dir=
- innodb_data_file_path=e:/MySQLDatafiles/ibdata1:10M;e:/MySQLDatafiles/ibdata2:1M:autoextend
- innodb_log_group_home_dir="d:/log/binlog/"
- default-character-set=utf8
- default-storage-engine=INNODB
- sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
- ...............
恢复冷备份后,执行日志恢复报错:
C:\mysqlbinlog d:/log/log.000002|mysql -uroot -pa
ERROR 1231 (42000) at line 10: Variable 'sql_mode' can't be set to the value of
'1344274432'
相关广告