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 are the common backup methods for mysql

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces the common backup methods of mysql. It is very detailed and has certain reference value. Friends who are interested must finish reading it.

1. Use the tar wrapper folder for backup. The database can save the data folder directly, but it takes up a lot of space and can be compressed and saved in tar packaging.

[root@localhost ~] # systemctl stop mysqld [root@localhost ~] # tar Jcvf / opt/mysql-$ (date +% F). Tar.xz / usr/local/mysql/data/ [root@localhost] # ls / opt/mysql-2021-10-25.tar.xz [root@localhost ~] # systemctl start mysqld

2. Use the mysqldump tool to back up the contents of the backup, for example, you can back up several tables or libraries separately.

[root@localhost] # mysqldump-u root-p123456-- databases info > / opt/info.sql # back up the info library [root@localhost ~] # ls / opt/info.sql is all the contents of this article "what are the common backup methods for mysql". 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

Development

Wechat

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

12
Report