备份数据库testmysqldump -uroot -p test > bak.sql还原:执行bak.sql自动备份:在windows中做一个自动任务,然后执行mysqldump -uroot -p test > bak.sql