1MYSQLHOTCOPY(1)             MariaDB Database System            MYSQLHOTCOPY(1)
2
3
4

NAME

6       mysqlhotcopy - a database backup program
7

SYNOPSIS

9       mysqlhotcopy arguments
10

DESCRIPTION

12       mysqlhotcopy is a Perl script that was originally written and
13       contributed by Tim Bunce. It uses FLUSH TABLES, LOCK TABLES, and cp or
14       scp to make a database backup. It is a fast way to make a backup of the
15       database or single tables, but it can be run only on the same machine
16       where the database directories are located.  mysqlhotcopy works only
17       for backing up MyISAM and ARCHIVE tables. It runs on Unix and NetWare.
18
19       To use mysqlhotcopy, you must have read access to the files for the
20       tables that you are backing up, the SELECT privilege for those tables,
21       the RELOAD privilege (to be able to execute FLUSH TABLES), and the LOCK
22       TABLES privilege (to be able to lock the tables).
23
24           shell> mysqlhotcopy db_name [/path/to/new_directory]
25
26           shell> mysqlhotcopy db_name_1 ... db_name_n /path/to/new_directory
27
28       Back up tables in the given database that match a regular expression:
29
30           shell> mysqlhotcopy db_name./regex/
31
32       The regular expression for the table name can be negated by prefixing
33       it with a tilde (“~”):
34
35           shell> mysqlhotcopy db_name./~regex/
36
37       mysqlhotcopy supports the following options, which can be specified on
38       the command line or in the [mysqlhotcopy] and [client] option file
39       groups.
40
41       ·   --help, -?
42
43           Display a help message and exit.
44
45       ·   --addtodest
46
47           Do not rename target directory (if it exists); merely add files to
48           it.
49
50       ·   --allowold
51
52           Do not abort if a target exists; rename it by adding an _old
53           suffix.
54
55       ·   --checkpoint=db_name.tbl_name
56
57           Insert checkpoint entries into the specified database db_name and
58           table tbl_name.
59
60       ·   --chroot=path
61
62           Base directory of the chroot jail in which mysqld operates. The
63           path value should match that of the --chroot option given to
64           mysqld.
65
66       ·   --debug
67
68           Enable debug output.
69
70       ·   --dryrun, -n
71
72           Report actions without performing them.
73
74       ·   --flushlog
75
76           Flush logs after all tables are locked.
77
78       ·   --host=host_name, -h host_name
79
80           The host name of the local host to use for making a TCP/IP
81           connection to the local server. By default, the connection is made
82           to localhost using a Unix socket file.
83
84       ·   --keepold
85
86           Do not delete previous (renamed) target when done.
87
88       ·   --method=command
89
90           The method for copying files (cp or scp). The default is cp.
91
92       ·   --noindices
93
94           Do not include full index files for MyISAM tables in the backup.
95           This makes the backup smaller and faster. The indexes for reloaded
96           tables can be reconstructed later with myisamchk -rq.
97
98       ·   --old-server
99
100           Connect to old MySQL-server (before v5.5) which doesn't have FLUSH
101           TABLES WITH READ LOCK fully implemented..
102
103       ·   --password=password, -ppassword
104
105           The password to use when connecting to the server. The password
106           value is not optional for this option, unlike for other MariaDB
107           programs.
108
109           Specifying a password on the command line should be considered
110           insecure. You can use an option file to avoid giving the password
111           on the command line.
112
113       ·   --port=port_num, -P port_num
114
115           The TCP/IP port number to use when connecting to the local server.
116
117       ·   --quiet, -q
118
119           Be silent except for errors.
120
121       ·   --record_log_pos=db_name.tbl_name
122
123           Record master and slave status in the specified database db_name
124           and table tbl_name.
125
126       ·   --regexp=expr
127
128           Copy all databases with names that match the given regular
129           expression.
130
131       ·   --resetmaster
132
133           Reset the binary log after locking all the tables.
134
135       ·   --resetslave
136
137           Reset the master.info file after locking all the tables.
138
139       ·   --socket=path, -S path
140
141           The Unix socket file to use for connections to localhost.
142
143       ·   --suffix=str
144
145           The suffix to use for names of copied databases.
146
147       ·   --tmpdir=path
148
149           The temporary directory. The default is /tmp.
150
151       ·   --user=user_name, -u user_name
152
153           The MariaDB user name to use when connecting to the server.
154
155       Use perldoc for additional mysqlhotcopy documentation, including
156       information about the structure of the tables needed for the
157       --checkpoint and --record_log_pos options:
158
159           shell> perldoc mysqlhotcopy
160
162       Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.,
163       2010-2015 MariaDB Foundation
164
165       This documentation is free software; you can redistribute it and/or
166       modify it only under the terms of the GNU General Public License as
167       published by the Free Software Foundation; version 2 of the License.
168
169       This documentation is distributed in the hope that it will be useful,
170       but WITHOUT ANY WARRANTY; without even the implied warranty of
171       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
172       General Public License for more details.
173
174       You should have received a copy of the GNU General Public License along
175       with the program; if not, write to the Free Software Foundation, Inc.,
176       51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see
177       http://www.gnu.org/licenses/.
178
179

SEE ALSO

181       For more information, please refer to the MariaDB Knowledge Base,
182       available online at https://mariadb.com/kb/
183

AUTHOR

185       MariaDB Foundation (http://www.mariadb.org/).
186
187
188
189MariaDB 10.3                      9 May 2017                   MYSQLHOTCOPY(1)
Impressum