#!bin/bash cd C:\Program Files\MySQL\MySQL Server 5.5\binset "Ymd=%date:~,4%%date:~5,2%%date:~8,2%-%time:~0,2%%time:~3,2%%time:~6,2%"
mysqldump -hip地址 -u 账号 --password=密码 数据库名 表名>D:/mysql_backups/employeeBackups/employee_month/employee_month_%Ymd%.sql WinRAR m -r -ep1 "D:/mysql_backups/employeeBackups/employee_month/employee_month_%Ymd%.zip" "D:/mysql_backups/employeeBackups/employee_month/employee_month_%Ymd%.sql"
新建一个记事本,修改为bat;
ps:文件只在C:下双击可以,在D:下能创建文件但是数据为0,一直没有找到原因
导入备份数据
mysql -uroot -p --default-character-set=utf8 data_analysis