数据库备份
1.创建个备份存储目录
mkdir /root/backup/
2.以下内容写到dbbackup.sh
#!/bin/bash
cd /root/backup/
mysqldump -uroot -pmima123 datatest >/root/backup/datatest`date +%Y-%m-%d`.sql
mysqldump -uroot -pmima123 datatest1 >/root/backup/datatest1`date +%Y-%m-%d`.sql
chmod +x dbbackup.sh
时间: 2024-10-11 05:34:27