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

What is the operation command of physical cold backup and recovery in the server?

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

Share

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

This article mainly introduces what is the operation command of physical cold backup and recovery in the server. It is very detailed and has a certain reference value. Interested friends must finish reading it!

Physical cold backup usually packages the database folder directly with the tar command, while the mysql service needs to be turned off using the "systemctl stop mysqld" command before the backup.

1) back up the database

Create a / bak directory as the backup data storage path and use tar to create backup files. The entire database folder backup is a full backup.

[root@centos01 ~] # systemctl stop mysqld [root@centos01 ~] mkdir / bak/ [root@centos01 ~] # tar zcf / bak/mysql_all-$ (date +% F). Mysql.gz / usr/local/mysql/data/ [root@centos01 ~] # ls / bak/-rw-r--r-- 1 root root 766598 October 31 03:57 / bak/mysql_all-2019-10-31.mysql.gz2) Restore database [root@centos01 ~] mkdir test [root@centos01 ~] # tar zxvf / bak/mysql_all-2019-10-31.mysql.gz-C. / test/ [root@centos01 data] # cd / usr/local/mysql/data/ [root@centos01 data] # rm-rf. / * [root@centos01 ~] # cd. / test/usr/local/mysql/data/ [root@centos01 date] # mv. / * / usr/local/mysql/data/ [root@centos01 ~] # systemctl start mysqld is all the contents of the article "what are the operation commands for physical cold backup and recovery in the server" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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

Servers

Wechat

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

12
Report