Get the App
SLTechnology News&Howtos  ›  Database  › 

How to make scheduled backups for CentOS7 MySQL

Shulou Source: shulou.com Published: 2022-05-31 14:17:12 11月14日 Update

This article mainly explains "how to make regular backups of CentOS7 MySQL". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "how to make regular backups for CentOS7 MySQL"!

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

Replace the Ali source

# 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 mysqldump

Yum install-y mariadb

Scheduled task

Because MySQL runs in a Docker container, you cannot connect locally using socket. You need to use the parameter-h227.0.0.1.

#% of scheduled tasks need to be escaped 0 1 * mysqldump-uzhangsan-ppassword-h227.0.0.1 dbName > / data/dbName_ `date'+\% Y\% m\% d\% H\% M\% S`. Sql 2 > & 1 so far, I believe you have a better understanding of "how to make scheduled backups in CentOS7 MySQL". You might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Backup task content data cache learning practical deeper important inexplicable interest parameter practicality practice container simple operation data backup file diagonal bar method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Microsoft MySQL Redmi Shulou Technology