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)06/01 Report--
This article mainly tells you how to operate the mysqlhotcopy command. You can look up the relevant professional terms on the Internet or find some related books to supplement them. We will not dabble here. Let's go straight to the topic. I hope that this article on how to operate the mysqlhotcopy command can bring you some practical help.
Mysqlhotcopy is a simple process of caching writes and file copies, consuming resources and backing up much faster than mysqldump. It is especially suitable for large databases, but it should be noted that mysqlhotcopy only supports MyISAM engine.
Perl support is required to use mysqlhotcopy because mysqlhotcopy is written in the prel language.
So install the following three perl packages before using them.
[plain]
Yum install-y perl perl-DBI perl-DBD-MySQL
After installation, if you install mysql normally, whether through yum,apt-get or source code, then you can use mysqlhotcopy directly.
Mysqlhotcopy principle
Mysqlhotcopy is a Perl script originally written and provided by Tim Bunce. It uses LOCK TABLES, FLUSH TABLES, and cp or scp to quickly back up the database. It is the fastest way to back up a database or a single table, but it can only run on the same machine as the database directory. Mysqlhotcopy is used only for backing up MyISAM. It runs in Unix and NetWare.
Actual operation
Here I have a habit of refreshing the binlog log during the hot backup. Mysqlhotcopy has a-- flushlog parameter to support this function.
So take a look at what binlog logs are in the database, as follows:
To see where the binlog log is used in that specific binlog file and where it is, you can use the following command:
At this point, knowing this, you can start hot standby.
$mysqlhotcopy-u user-p password-- flushlog djangodb / tmp
# Note-there must be a space between u user-p password, otherwise mysqlhotcopy will not recognize it, which is different from the mysql,mysqldump command.
Djangodb refers to the name of the library
/ tmp refers to the location of the directory to be backed up. After backup, a djangodb directory with relevant data files will be created under / tmp, as shown below:
It is also important to note that you have to have select,reload (for flush tables), lock tables permission.
OK, after the backup, you can take a look at the binlog log, now there is an extra binlog log.
The position location in the binlog log has also changed.
Here-flushlog, mainly for backup and reply point of view.
Generally speaking, this is enough. If you have any special needs, you can take a look at the specific parameters of man mysqlhotcopy.
How to operate the mysqlhotcopy command will first tell you here, for other related issues you want to know can continue to pay attention to our industry information. Our section will capture some industry news and professional knowledge to share with you every day.
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.