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

MySQL mysqldump and mysqlbinlog backup and restore tutorials

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Let's learn about MySQL mysqldump and mysqlbinlog backup and restore tutorials, I believe you will benefit a lot after reading, the text in the essence is not much, hope that MySQL mysqldump and mysqlbinlog backup and restore tutorials this short content is what you want.

1. Use mysqlbinlog to make continuous backups of binary logs:

Mysqlbinlog-u root-p-R-host='localhost'-- raw-- stop-never mysql_bin.000001

two。 Use mysqldump to create dump files as snapshots of CVM data, and execute mysqldump commands periodically to create updated snapshots as needed:

Mysqldump-u root-p-- host='localhost'-B test-- events-- routines-- master-data=2 > test.sql

3. Insert data:

Insert into person (name) values ('Gao Yu'), ('Bruce Lee'), ('giant')

4. Simulated CVM crashes and test database data is lost

Stop continuously backing up log binaries and delete test libraries

Drop database test

5. Restore the data using the latest dump file:

Mysql-- host='localhost'-u root-p < test.sql

6. Use a binary log backup to re-execute events written after the coordinates listed in the dump file. Suppose the coordinates in the file are as follows:

Cat test.sql

Mysqlbinlog-- start-position=11125 mysql_bin.000001 | mysql-- host='localhost'-u root-p

View data: select * from peison

After reading this article on MySQL mysqldump and mysqlbinlog backup and restore tutorials, many readers will want to know more about it. For more industry information, you can follow our industry information section.

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

Database

Wechat

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

12
Report