In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
What should I do to configure automatic backup of mysql database in centos? Many people do not know much about it. Today, in order to let you know more about the method of configuring automatic backup of mysql database in centos, I have summarized the following contents. Let's look down together.
1. Check the disk space
Execute df-h to select the directory with the largest remaining space (take the / directory as an example)
2. Create a backup directory
Cd / mkdir backupcd backup
(related video tutorials share: mysql video tutorials)
3. Create a backup Shell script
Vim monarch-bak.sh # monarch is the database name mysqldump-uroot-p980225 monarch > / backup/monarch_$ (date +% Y-%m-%d_%H:%M:%S) .SQL # compress the backup: mysqldump-uusername-ppassword DatabaseName | gzip > / home/backup/DatabaseName_$ (date +% Y%m%d_%H%M%S) .sql.gz
4. Add executable permissions:
Chmod upright x monarch-bak.sh
Execute it after adding executable permissions to see if there are any errors in the script and whether it can be used normally:. / bkDatabaseName.sh
5. Add scheduled backup tasks
Confirm that crontab is installed.
Crontab-e
Add:
22 11 * source / backup/monarch-bak.sh # explain executing the / backup/monarch-bak.sh script at 11:22 every day
Restart crontab:
Service crond restart
The above is a brief introduction of how to configure automatic backup of mysql database in centos. Of course, the differences in the detailed use of the above have to be understood by everyone. If you want to know more, 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.