mysqldump 备份某张表 Warning: A partial dump from a server that has GTIDs will by default include the GTI

Posted 运维工匠实战(如果发现有错误请大家把正确的方法发送给我,方便

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysqldump 备份某张表 Warning: A partial dump from a server that has GTIDs will by default include the GTI相关的知识,希望对你有一定的参考价值。

 

[[email protected] ok]# mysqldump -uemove -h xx.xx.xx.xx -P9906 DBname t_name -p >2t_tname.sql
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions,
even those that changed suppressed parts of the database. If you don‘t want to restore GTIDs,
pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.
[[email protected] Desktop]# mysqldump --version
mysqldump  Ver 10.13 Distrib 5.6.34, for Linux (x86_64)
关于GTID是5.6以后,加入了全局事务 ID (GTID) 来强化数据库的主备一致性,故障恢复,以及容错能力。
官方给的:A global transaction identifier (GTID) is a unique identifier created and associated with each transaction committed on the server of origin (master).
所以可能是因为在一个数据库里面唯一,但是当导入其他的库就有可能重复。所有会有一个提醒。

可以通过添加--set-gtid-purged=off 或者–gtid-mode=OFF这两个参数设置。
个人认为是在导入库中重新生产GTID,而不用原来的。
[[email protected] ok]# mysqldump -uUsername -h xx.xx.xx.xx -P9996 DBname t_name --set-gtid-purged=off -p >t_name.sql(表名)

 




以上是关于mysqldump 备份某张表 Warning: A partial dump from a server that has GTIDs will by default include the GTI的主要内容,如果未能解决你的问题,请参考以下文章

mysqldump 备份导出数据排除某张表或多张表

从MySQL全库备份中恢复某个库和某张表

从MySQL全库备份中恢复某个库和某张表

oracle 备份某张表的全部数据

MongoDB数据库的备份恢复

mysql库备份&库恢复