In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to solve the MySQL Backup problem". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to solve the MySQL Backup problem.
#! / bin/bash
TARGET=/BACKUP
Export DT= `date + "% Y%m%d_%H%M" `
Export DESTDIR=$ {TARGET} / `date + "% Y%m%d/mysql" `
TMPNAME=_dump_sql_tmp_$$
Function Backup ()
{
Local SERVER
SERVER=$1
BASE= "$SERVER" _ ${DT}
CURDIR= `pwd`
Echo "${SERVER} to ${BASE}:"
DEST=$ {DESTDIR} / ${SERVER} / ${DT}
Mkdir-p ${DEST}
Cd ${DEST}
# getting list of databases...
Echo "SHOW DATABASES;" | mysql-pPASSWORD-u USER-h ${SERVER} > ${TMPNAME}
While read DB
Do
If [$DB! = "Database"]; then
Echo-n "${DB}:"
Mysqldump-Q-all-complete-insert-quote-names-add-drop-table-pPASSWORD-u USER-h ${SERVER} ${DB} > ${BASE} _ ${DB} .MySQL
Echo-n "md5"
Md5sum-b ${BASE} _ ${DB} .MySQL > ${BASE} _ ${DB} .md5sum
Echo-n ", tar"
Tar-- remove-files-zcf ${BASE} _ ${DB} .tgz ${BASE} _ ${DB}. *
Echo ", md5"
Md5sum-b ${BASE} _ ${DB} .tgz > ${BASE} _ ${DB} .md5sum
Fi
Done
< ${TMPNAME} rm -f ${TMPNAME} cd ${CURDIR} echo "Done." } # Call for all your servers Backup localhost Backup my.othersever.com #!/usr/bin/perl# mysql_backup.cgi#################################################################################### POD Documentation=head1 PROGRAM NAME AND AUTHOR MySQL Backup v3.3 by Peter Falkenberg Brown peterbrown@worldcommunity.com http://worldcommunity.com/opensource/ Build Date: September 14, 2008=PURPOSE Backs up mysql data safely, using 'mysqldump', 'select to outfile' or 'normal record selection'. This is my attempt :-) to provide a reasonably full featured MySQL backup script that can be run from: 1. Linux Crontab or Windows Scheduler 2. the shell or command prompt 3. the web (with password protection) (Note that I don't recommend running it from the web because of permission issues - however, some users don't have shell access. It depends upon the security level of your data. It now works from both Linux and Windows. See URLs at the end about where to get WINDOWS VERSION OF UNIX UTILITIES. It provides options to backup all of the databases and tables in one particular host, with exception lists. It now has the ability to select a variety of options for the tar and gzip functions, including using the tar -z switch, using bzip2 and piping data through gzip/bzip2. It also deletes text files in between tar and gzip, to save space. It also works around the sql wildcard glitch with underlines (_), in table names, by not using mysqlshow to get table names. I did this, because mysqlshow db % didn't work under MySQL v3.22.20a, and I wasn't able to determine when the % method came into being (under which version.) So, in order to make things work for earlier versions, I used 'show tables'. (I still use mysqlshow for database names.)=COPYRIGHT Copyright 2000-2008 Peter Falkenberg Brown (WCP - The World Community Press) This program complies with the GNU GENERAL PUBLIC LICENSE and is released as "Open Source Software". NO WARRANTY IS OFFERED FOR THE USE OF THIS SOFTWARE=BUG REPORTS AND SUPPORT Send bug reports to peterbrown@worldcommunity.com.=OBTAINING THE LATEST VERSION ==>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.