MySQL - Is there a way to include the bin log position in the dump file without scripting

StackOverflow https://stackoverflow.com/questions/12025193

문제

Is there a way to include the replication bin log position in the dump file without scripting?

I know there are ways through scripting, appending a line to the dump file etc. But I remember once reading that it's possible through a simple argument in mysqldump, is that true and if yes what's the syntax?

Thanks a lot

도움이 되었습니까?

해결책

Great, I've found the answer:

the --master-data option allows this

mysqldump --master-data=1 ... needs to be run on the master and will include a sql that will change the MySQL instance's master to the current file/log position automatically.

if 2 is used instead of 1 then it only writes a comment, which is also useful for manual setups...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top