1、修改mysql密码
vim /etc/my.cnf
增加参数
skip-grant-tables
service mysql restart;
update mysql.user set password=password(‘mima’) where user=’root’
2、压缩文件
tar zvcf yilitewine.com.tar.gz –exclude=”*www_logs*” yilitewine.com
下载压缩
scp -P 52383 211.155.23.83:/web/users/yilitewine.com.tar.gz /root/
循环压缩
a b c d
程序 数据库
for i in a b c d
do
tar zvcf $i.tar.gz –exclude=”*www_logs*” $i
done
3、数据库转移备份
A.mysqldump -uroot -pxxxx yilitewine>yilitewine.sql(建议)
B.拷贝数据文件
C.xtrabackup
增量同步
screen rsync -avH –progress ‘-e ssh -p 52383’ root@211.155.23.83:/backup/nowmysql/ /data/211.155.23.83/nowmysql/
ctrl+A D
查看后台任务
screen -ls
切换到前台查看进度:
screen -r 22535
ps -ef|grep mysql
–datadir 数据库目录