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 learning

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

Share

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

The file exported by mysqldump is actually a sql script

For example:

Mysqldump-- single-transaction-- all-databases > / mysql/mysqldump_20180612

Mysqldump-single-transaction-all-databases-flush-logs-master-data=2 > / mysql/mysqldump_20180613.sql

-- the master-data=2 option, which produces the following output in the resulting backup, telling where the recovery should start with binlog

--

-- Position to start replication or point-in-time recovery from

--

-- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000015', MASTER_LOG_POS=154

--

-- master-data option, you can

You can use mysqldump + binlog for backup to prevent data loss

Flush logs or mysqladmin flush-logs can close the current binary log file and switch to a new binary log file

The following command is used to restore:

Mysql < / mysql/mysqldump_20180613.sql

Mysqlbinlog gbichot2-bin.000007 gbichot2-bin.000008 | mysql

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