版本:5.5.14
OS: ConetOS 6.3
1、创建recover.sh
[root@yoon export]# vi recover.sh
#!/bin/bash
bakdir=/export/data
mysql=/export/servers/mysql/bin/mysql
user=root
passwd=123456
for port in {3361..3362}
do
($mysql -u$user -p$passwd -S /export/data/mysql/tmp/mysql$port.sock < `cat /home/mysql/bakinfo|grep $port|awk -F, '{print $2}'`) &
done
2、创建bakinfo文件
[root@yoon export]# vi bakinfo
3361,/export/backup/all.255.10-2014-03-31.sql
3362,/export/backup/all.255.11-2014-03-31.sql