A brief Analysis of the method of importing mysql Master Library data into Slave Library
The following is mainly to bring you how to import mysql master database data from the library method analysis, hope how to import mysql master database data from the library method analysis can bring you practical use, this is also the main purpose of my editing this article. Okay, no more nonsense, let's go straight to the following.
mysql master database data import to slave database
1. Main database data export
#msyqldump -uroot -p123456 -S /tmp/mysql.sock -A --events -B -x --master-data=1|gzip >/opt/$(date +%F_%T).sql.gz
2. Import database from library
Copy the backed up database and import it into the slave repository.
#scp root@172.16.1.9:/opt/$(date +%F_%T).sql.gz /sqlbak/Address 172.16.1.9 maps to bogon, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT! root@172.16.1.9's password: 2019-08-05_11:09:31.sql.gz 100% 159KB 158.7KB/s 00:00 #gzip -d $(date +%F_%T).sql.gz#mysql -uroot -p123456 -S /tmp/mysql.sock show databases; #Check whether the data imported from the library is successful
For the above analysis on how to import mysql master database data into slave database, do you think it is very helpful? If you need to know more, please continue to pay attention to our industry information, I believe you will like these contents.