mysql import data from a master database library

mysql data into the main library from the library

1, the main library data export

#msyqldump -uroot -p123456 -S /tmp/mysql.sock -A --events -B -x --master-data=1|gzip >/opt/$(date +%F_%T).sql.gz


2, into the database from the library

       A backup copy of the database, and introduced into the library.

[email protected] #scp: / opt / $ (DATE F_% +% T) .sql.gz / sqlbak / 
the Address Maps to bogon 172.16.1.9, But Not the this does Map Back to The address - the IN POSSIBLE BREAK-ATTEMPT ! 
[email protected]'s password:  
2019-08-05_11: 09: 100% 31.sql.gz 158.7KB 159KB / S 00:00     

#gzip -d $ (DATE F_% +% T) .sql.gz 

#mysql -uroot -p123456 -S /tmp/mysql.sock </ sqlbak / $ (date +% F_% T) .sql # import data into the database from the master database 

-p123456 # Log from the library #mysql -uroot 
mysql> show databases; # see if the import was successful from the data library

 

Guess you like

Origin blog.51cto.com/13006632/2426692