This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
database:mysql [2019/04/02 13:52] – [Master-Master Replication] tmade | database:mysql [2019/06/06 14:41] (current) – [Restore] tmade | ||
---|---|---|---|
Line 14: | Line 14: | ||
==== Backup ==== | ==== Backup ==== | ||
- | Example backupscript to backup each database as a singe file: | + | Example backupscript to backup each database as a single |
< | < | ||
#!/bin/bash | #!/bin/bash | ||
Line 94: | Line 94: | ||
mysqldump --user=${USERNAME} --password --host=${DBHOST} --port=${PORT} --quick --triggers --routines --events --add-drop-database --single-transaction --master-data --hex-blob --databases $candidates | gzip > $BACKUPDIR/ | mysqldump --user=${USERNAME} --password --host=${DBHOST} --port=${PORT} --quick --triggers --routines --events --add-drop-database --single-transaction --master-data --hex-blob --databases $candidates | gzip > $BACKUPDIR/ | ||
</ | </ | ||
+ | |||
+ | Check also: | ||
+ | |||
+ | https:// | ||
==== Restore ==== | ==== Restore ==== | ||
- | Ceate a file with following content and make it executable (chmod +x import_db.sh) | + | Create |
< | < | ||
Line 381: | Line 385: | ||
CHANGE MASTER TO MASTER_HOST=" | CHANGE MASTER TO MASTER_HOST=" | ||
- | as master and creadentials isn´t | + | as master and credentials aren´t |
+ | |||
+ | See also on: | ||
+ | |||
+ | https:// | ||
Activate/ deactivate " | Activate/ deactivate " |