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

How to back up mysql data regularly in CentOS 7

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

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to backup mysql data regularly in CentOS 7. The content of the article is of high quality, so Xiaobian shares it with you as a reference. I hope you have a certain understanding of relevant knowledge after reading this article.

How to backup mysql data regularly in CentOS 7? The following article will introduce you to CentOS 7 regular backup mysql data method, I hope to help you!

Data backup is really important, because one day data may be deleted inexplicably.

I'll show you how to use crontab and mysqldump to back up mysql data on CentOS 7 on a regular basis.

Replace aliyuan #backup repo file cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak#download wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repoyum clean all #clear cache yum makecache #generate cache yum update install mysqldumpyum install -y mariadb timed task

Since MySQL runs in Docker containers, local connections cannot be made using sockets, and you need to use the parameter-h227.0.0.1.

# % in timed task needs to be escaped with tilt rod 0 1 * * * mysqldump -uzhangsan -ppassword -h227.0.0.1 dbName > /data/dbName_`date '+\%Y\%m\%d\%H\%M\%S'`.sql 2>&1

How to backup mysql data regularly in CentOS 7 is shared here. I hope the above content can be of some help to everyone and learn more knowledge. If you think the article is good, you can share it so that more people can see it.

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