Tips for using mysqlhotcopy regular expressions _ MySQL
Source: Internet
Author: User
Tips for using mysqlhotcopy regular expressions bitsCN. commysqlhotcopy is a MySQL hot standby tool. For more information, see the manual. for security reasons, we will assign users to hot standby:
Grant select, reload, lock tables on *. * to 'hotcopy' @ 'localhost' identified by '123 ';
If we only want to hot-standby some of the data, we may use regular expressions. use mysqlhotcopy -- help to see the supported options, including: -- regexp: this regular expression matches the database name. for example, to back up a database starting with abc, you can use:
Mysqlhotcopy -- flushlog-u = 'hotcopy'-p = '000000' -- regexp = ^ abc/home/bak
To back up a database starting with [a-d], you can use:
Mysqlhotcopy -- flushlog-u = 'hotcopy'-p = '000000' -- regexp = ^ [a-d]/home/bak
To back up some tables in a database, you may need to use the following methods:
Back up tables starting with abc in the test database:
Mysqlhotcopy -- flushlog-u = 'hotcopy'-p = '000000' test./^ abc // home/bak
Back up tables starting with abc in the test database:
Mysqlhotcopy -- flushlog-u = 'hotcopy'-p = '000000' test ./~ ^ Abc // home/bak
Back up tables starting with abc_a, abc_ B, abc_c, abc_d, abc_e,... and abc_w in the test database:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.