Answer the question
In order to leave comments, you need to log in
Mysqldump for master-slave: how to dump and upload several databases at once?
Hello! There is a server1 on which 6 bases are twisted. You need to set up a slave where 3 of them will be replicated. I do this:
I do a DB1 dump
mysqldump -u root --master-data=2 --single-transaction DB1 > DB1.sql
mysql -u root DB1 < DB1.sql
mysqldump -uroot -p -B DB1 DB2 DB3 > databases.sql
Answer the question
In order to leave comments, you need to log in
Do a dump:
mysqldump --all-databases -u root --master-data=2 --single-transaction > DBs.sql
all databases will be there at once. No need to list them on the command line.
Fill in the same way:
mysql -u root < DBs.sql
After start replication
PS I used to dump something like this
mysqldump --flush-privileges --flush-logs --triggers --routines --events --hex-blob -- extended-insert --complete-insert --no-autocommit --lock-all-tables --master-data=2 --all-databases
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question