一、备份数据命令:
mysqldump -u root -p zzqndyy_emr |gzip -9 > /root/6yc_zzqndyy_emr-20180115.gz
出错:
1、 报错1045
1045 Access denied for user 'root'@'localhost' (using password:YES)
解决方式:
在/ETC/MY.CNF文件中
[mysqld] 下,添加skip_grant_tables 后重启
2、 报错2002
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when trying to connect
解决方式:
输入以下命令:
ln -fs /usr/local/mysql/bin/mysqldump /usr/bin
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
二、远程传输备份文件:
scp /root/10wz_dbemr_txxrmyy-20180115.gz 10.253.1.16:/data/qianzhiji/20180115/10wz_dbemr_txxrmyy-20180115.gz
转载于:https://blog.51cto.com/11736574/2061381