1.備份
mysqldump -u root -h 127.0.0.1 -p --set-gtid-purged=OFF abc > /data/mysqlBak/abc_20200206.sql
2.恢復(fù)
將備份的數(shù)據(jù)庫恢復(fù)到新的數(shù)據(jù)庫abc-2
1)需要創(chuàng)建數(shù)據(jù)庫abc-2
mysql -u root -h 127.0.0.1 -p
create database `abc-2`;
quit;
2)恢復(fù)數(shù)據(jù)
LINUX命令行下執(zhí)行
mysql -u root -h 127.0.0.1 -p abc-2 < /data/mysqlBak/abc_20200206.sql