Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

A brief Analysis of the method of importing mysql Master Library data into Slave Library

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report