一、bat脚本导出数据
@echo off
color 0a
title 系统数据备份
echo 开始备份,请稍后……
echo 备份完成之前,请勿关闭本窗口……
forfiles /p “F:/soft/dbbak” /m duo*.sql -d -30 /c “cmd /c del /f @path”
set “myDate=%date:~0,4%%date:~5,2%%date:~8,2%0%time:~1,1%%time:~3,2%%time:~6,2%”
F:/soft/phpenv/server/mysql/mysql-5.5/bin/mysqldump —opt -u 用户名 —password=密码 duo > F:/soft/dbbak/duo%myDate%.sql
@echo on
二、导入数据问题:
1292 - Incorrect datetime value: 0000-00-00 00:00:00 for column expected_time at row 46 With
时间日期格式问题:
打开mysql下mysql.ini文件
在[mysqld]下面加一句
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
保存,重启mysql,完成,问题解决
[ERR] 2013 - Lost connection to MySQL server during query
建议临时解决:
set global max_allowed_packet=524288000;
继续导入即可