mysql数据据备份与还原

时间:2022-09-14 00:15:08

http://www.cnblogs.com/kissdodog/p/4174421.html
备份:mysqldump -u username -p dbname > BackupName.sql
还原:mysql -u root -p [dbname] < backup.sql

 

//定时备份
crontab定时
30 04 * * * /data/dbbackup/dbmysqldump.sh

dbmysqldump.sh
mysqldump -uroot -piyenei123 wdb_pro > /data/dumpbak/wdb_pro_$(date +%Y%m%d_%H%m%s).sql