1
.\" Title: \fBdrizzledump\fR
3
.\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
5
.\" Manual: drizzle Database System
6
.\" Source: drizzle 6.0
8
.TH "\fBMYSQLDUMP\fR" "1" "05/23/2009" "drizzle" "drizzle Database System"
9
.\" disable hyphenation
11
.\" disable justification (adjust text to left margin only)
14
drizzledump \- a database backup program
17
\fBdrizzledump [\fR\fB\fIoptions\fR\fR\fB] [\fR\fB\fIdb_name\fR\fR\fB [\fR\fB\fItbl_name\fR\fR\fB ...]]\fR
22
client is a backup program originally written by Igor Romanenko. It can be used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a drizzle server). The dump typically contains SQL statements to create the table, populate it, or both. However,
24
can also be used to generate files in CSV, other delimited text, or XML format.
26
There are three general ways to invoke
31
shell> \fBdrizzledump [\fR\fB\fIoptions\fR\fR\fB] \fR\fB\fIdb_name\fR\fR\fB [\fR\fB\fItables\fR\fR\fB]\fR
32
shell> \fBdrizzledump [\fR\fB\fIoptions\fR\fR\fB] \-\-databases \fR\fB\fIdb_name1\fR\fR\fB [\fR\fB\fIdb_name2\fR\fR\fB \fR\fB\fIdb_name3\fR\fR\fB...]\fR
33
shell> \fBdrizzledump [\fR\fB\fIoptions\fR\fR\fB] \-\-all\-databases\fR
37
If you do not name any tables following
42
\fB\-\-all\-databases\fR
43
option, entire databases are dumped.
48
database. If you name that database explicitly on the command line,
52
To get a list of the options your version of
55
\fBdrizzledump \-\-help\fR.
59
options are shorthand for groups of other options.
63
fall into this category. For example, use of
65
is the same as specifying
66
\fB\-\-add\-drop\-table\fR
68
\fB\-\-create\-options\fR
69
\fB\-\-disable\-keys\fR
70
\fB\-\-extended\-insert\fR
71
\fB\-\-lock\-tables\fR
73
\fB\-\-set\-charset\fR. Note that all of the options that
75
stands for also are on by default because
79
To reverse the effect of a group option, uses its
80
\fB\-\-skip\-\fR\fB\fIxxx\fR\fR
81
form (\fB\-\-skip\-opt\fR
83
\fB\-\-skip\-compact\fR). It is also possible to select only part of the effect of a group option by following it with options that enable or disable specific features. Here are some examples:
86
To select the effect of
88
except for some features, use the
90
option for each feature. For example, to disable extended inserts and memory buffering, use
92
\fB\-\-skip\-extended\-insert\fR
93
\fB\-\-skip\-quick\fR. (
94
\fB\-\-skip\-extended\-insert\fR
103
for all features except index disabling and table locking, use
105
\fB\-\-disable\-keys\fR
106
\fB\-\-lock\-tables\fR.
110
When you selectively enable or disable the effect of a group option, order is important because options are processed first to last. For example,
111
\fB\-\-disable\-keys\fR
112
\fB\-\-lock\-tables\fR
114
would not have the intended effect; it is the same as
119
can retrieve and dump table contents row by row, or it can retrieve the entire content from a table and buffer it in memory before dumping it. Buffering in memory can be a problem if you are dumping large tables. To dump tables row by row, use the
122
\fB\-\-opt\fR, which enables
123
\fB\-\-quick\fR). The
126
\fB\-\-quick\fR) is enabled by default; to enable memory buffering, use
127
\fB\-\-skip\-quick\fR.
129
If you are using a recent version of
131
to generate a dump to be reloaded into a very old drizzle server, you should not use the
134
\fB\-\-extended\-insert\fR
140
supports the options in the following list.
146
Display a help message and exit.
149
\fB\-\-add\-drop\-database\fR
153
statement before each
158
\fB\-\-add\-drop\-table\fR
162
statement before each
169
Surround each table dump with
173
statements. This results in faster inserts when the dump file is reloaded.
176
\fB\-\-all\-databases\fR,
179
Dump all tables in all databases. This is the same as using the
181
option and naming all the databases on the command line.
184
\fB\-\-allow\-keywords\fR
186
Allow creation of column names that are keywords. This works by prefixing each column name with the table name.
189
\fB\-\-apply\-slave\-statements\fR
191
For a slave dump produced with the
192
\fB\-\-dump\-slave\fR
199
statement at the end of the output.
202
\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
204
The directory where character sets are installed.
210
Write additional information in the dump file such as program version, server version, and host. This option is enabled by default. To suppress this additional information, use
211
\fB\-\-skip\-comments\fR.
216
Produce less verbose output. This option enables the
217
\fB\-\-skip\-add\-drop\-table\fR,
218
\fB\-\-skip\-add\-locks\fR,
219
\fB\-\-skip\-comments\fR,
220
\fB\-\-skip\-disable\-keys\fR, and
221
\fB\-\-skip\-set\-charset\fR
225
\fB\-\-compatible=\fR\fB\fIname\fR\fR
227
Produce output that is more compatible with other database systems or with older drizzle servers. The value of
240
no_field_options. To use several values, separate them by commas. These values have the same meaning as the corresponding options for setting the server SQL mode.
242
This option does not guarantee compatibility with other servers. It only enables those SQL mode values that are currently available for making dump output more compatible. For example,
243
\fB\-\-compatible=oracle\fR
244
does not map data types to Oracle types or use Oracle comment syntax.
246
\fIThis option requires a server version of 4.1.0 or higher\fR. With older servers, it does nothing.
249
\fB\-\-complete\-insert\fR,
254
statements that include column names.
260
Compress all information sent between the client and the server if both support compression.
263
\fB\-\-create\-options\fR
265
Include all drizzle\-specific table options in the
273
Dump several databases. Normally,
275
treats the first name argument on the command line as a database name and following names as table names. With this option, it treats all name arguments as database names.
279
statements are included in the output before each new database.
282
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
283
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
285
Write a debugging log. A typical
288
\'d:t:o,\fIfile_name\fR'. The default value is
289
\'d:t:o,/tmp/drizzledump.trace'.
292
\fB\-\-debug\-check\fR
294
Print some debugging information when the program exits.
297
\fB\-\-debug\-info\fR
299
Print debugging information and memory and CPU usage statistics when the program exits.
302
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
306
as the default character set. If no character set is specified,
311
This option has no effect for output data files produced by using the
313
option. See the description for that option.
316
\fB\-\-delayed\-insert\fR
320
statements rather than
325
\fB\-\-delete\-master\-logs\fR
327
On a master replication server, delete the binary logs after performing the dump operation. This option automatically enables
328
\fB\-\-master\-data\fR.
331
\fB\-\-disable\-keys\fR,
334
For each table, surround the
337
/*!40000 ALTER TABLE \fItbl_name\fR DISABLE KEYS */;
339
/*!40000 ALTER TABLE \fItbl_name\fR ENABLE KEYS */;
340
statements. This makes loading the dump file faster because the indexes are created after all rows are inserted. This option is effective only for non\-unique indexes of
349
\-\- Dump completed on \fIDATE\fR
350
comment at the end of the dump if the
352
option is given. However, the date causes dump files for identical data take at different times to appear to be different.
355
\fB\-\-skip\-dump\-date\fR
356
control whether the date is added to the comment. The default is
358
(include the date in the comment).
359
\fB\-\-skip\-dump\-date\fR
360
suppresses date printing.
363
\fB\-\-dump\-slave[=\fR\fB\fIvalue\fR\fR\fB]\fR
365
This option is similar to
366
\fB\-\-master\-data\fR
367
except that it is used to dump a replication slave server to produce a dump file that can be used to set up another server as a slave that has the same master as the dumped server. It causes the dump output to include a
369
statement that indicates the binary log coordinates (file name and position) of the dumped slave's master (rather than the coordinates of the dumped server, as is done by the
370
\fB\-\-master\-data\fR
371
option). These are the master server coordinates from which the slave should start replicating.
373
The option value is handled the same way as for
374
\fB\-\-master\-data\fR
375
and has the same effect as
376
\fB\-\-master\-data\fR
377
in terms of enabling or disabling other options and in how locking is handled.
380
\fB\-\-dump\-slave\fR, the
381
\fB\-\-apply\-slave\-statements\fR
383
\fB\-\-include\-master\-host\-port\fR
384
options can also be used.
390
Dump events from the dumped databases.
393
\fB\-\-extended\-insert\fR,
398
syntax that include several
400
lists. This results in a smaller dump file and speeds up inserts when the file is reloaded.
403
\fB\-\-fields\-terminated\-by=...\fR,
404
\fB\-\-fields\-enclosed\-by=...\fR,
405
\fB\-\-fields\-optionally\-enclosed\-by=...\fR,
406
\fB\-\-fields\-escaped\-by=...\fR
408
These options are used with the
410
option and have the same meaning as the corresponding clauses for
414
\fB\-\-first\-slave\fR,
417
Deprecated. Now renamed to
418
\fB\-\-lock\-all\-tables\fR.
421
\fB\-\-flush\-logs\fR,
424
Flush the drizzle server log files before starting the dump. This option requires the
426
privilege. Note that if you use this option in combination with the
427
\fB\-\-all\-databases\fR
429
\fB\-A\fR) option, the logs are flushed
430
\fIfor each database dumped\fR. The exception is when using
431
\fB\-\-lock\-all\-tables\fR
433
\fB\-\-master\-data\fR: In this case, the logs are flushed only once, corresponding to the moment that all tables are locked. If you want your dump and the log flush to happen at exactly the same moment, you should use
434
\fB\-\-flush\-logs\fR
436
\fB\-\-lock\-all\-tables\fR
438
\fB\-\-master\-data\fR.
441
\fB\-\-flush\-privileges\fR
445
statement after dumping the
447
database. This option should be used any time the dump contains the
449
database and any other database that depends on the data in the
451
database for proper restoration.
457
Continue even if an SQL error occurs during a table dump.
459
One use for this option is to cause
461
to continue executing even when it encounters a view that has become invalid because the definition refers to a table that has been dropped. Without
464
exits with an error message. With
467
prints the error message, but it also writes an SQL comment containing the view definition to the dump output and continues executing.
470
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
471
\fB\-h \fR\fB\fIhost_name\fR\fR
473
Dump data from the drizzle server on the given host. The default host is
479
Dump binary columns using hexadecimal notation (for example,
482
0x616263). The affected data types are
489
\fB\-\-include\-master\-host\-port\fR
493
statement in a slave dump produced with the
494
\fB\-\-dump\-slave\fR
499
options for the host name and TCP/IP port number of the slave's master.
502
\fB\-\-ignore\-table=\fR\fB\fIdb_name.tbl_name\fR\fR
504
Do not dump the given table, which must be specified using both the database and table names. To ignore multiple tables, use this option multiple times. This option also can be used to ignore views.
507
\fB\-\-insert\-ignore\fR
516
\fB\-\-lines\-terminated\-by=...\fR
518
This option is used with the
520
option and has the same meaning as the corresponding clause for
524
\fB\-\-lock\-all\-tables\fR,
527
Lock all tables across all databases. This is achieved by acquiring a global read lock for the duration of the whole dump. This option automatically turns off
528
\fB\-\-single\-transaction\fR
530
\fB\-\-lock\-tables\fR.
533
\fB\-\-lock\-tables\fR,
536
Lock all tables before dumping them. The tables are locked with
538
to allow concurrent inserts in the case of
540
tables. For transactional tables such as
544
\fB\-\-single\-transaction\fR
545
is a much better option, because it does not need to lock the tables at all.
547
Please note that when dumping multiple databases,
548
\fB\-\-lock\-tables\fR
549
locks tables for each database separately. Therefore, this option does not guarantee that the tables in the dump file are logically consistent between databases. Tables in different databases may be dumped in completely different states.
552
\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR
554
Append warnings and errors to the named file.
557
\fB\-\-master\-data[=\fR\fB\fIvalue\fR\fR\fB]\fR
559
Use this option to dump a master replication server to produce a dump file that can be used to set up another server as a slave of the master. It causes the dump output to include a
561
statement that indicates the binary log coordinates (file name and position) of the dumped server. These are the master server coordinates from which the slave should start replicating.
563
If the option value is 2, the
565
statement is written as an SQL comment, and thus is informative only; it has no effect when the dump file is reloaded. If the option value is 1, the statement takes effect when the dump file is reloaded. If the option value is not specified, the default value is 1.
567
This option requires the
569
privilege and the binary log must be enabled.
572
\fB\-\-master\-data\fR
573
option automatically turns off
574
\fB\-\-lock\-tables\fR. It also turns on
575
\fB\-\-lock\-all\-tables\fR, unless
576
\fB\-\-single\-transaction\fR
577
also is specified, in which case, a global read lock is acquired only for a short time at the beginning of the dump (see the description for
578
\fB\-\-single\-transaction\fR). In all cases, any action on logs happens at the exact moment of the dump.
580
It is also possible to set up a slave by dumping an existing slave of the master. To do this, use the
581
\fB\-\-dump\-slave\fR
585
\fB\-\-no\-autocommit\fR
589
statements for each dumped table within
596
\fB\-\-no\-create\-db\fR,
599
This option suppresses the
601
statements that are otherwise included in the output if the
604
\fB\-\-all\-databases\fR
608
\fB\-\-no\-create\-info\fR,
613
statements that re\-create each dumped table.
619
Do not write any table row information (that is, do not dump table contents). This is very useful if you want to dump only the
621
statement for the table.
624
\fB\-\-no\-set\-names\fR
626
This option is deprecated. Use
627
\fB\-\-skip\-set\-charset\fR. instead.
632
This option is shorthand; it is the same as specifying
633
\fB\-\-add\-drop\-table\fR
635
\fB\-\-create\-options\fR
636
\fB\-\-disable\-keys\fR
637
\fB\-\-extended\-insert\fR
638
\fB\-\-lock\-tables\fR
640
\fB\-\-set\-charset\fR. It should give you a fast dump operation and produce a dump file that can be reloaded into a drizzle server quickly.
642
\fIThe \fR\fI\fB\-\-opt\fR\fR\fI option is enabled by default. Use \fR\fI\fB\-\-skip\-opt\fR\fR\fI to disable it.\fR
643
See the discussion at the beginning of this section for information about selectively enabling or disabling certain of the options affected by
647
\fB\-\-order\-by\-primary\fR
649
Sorts each table's rows by its primary key, or by its first unique index, if such an index exists. This is useful when dumping a
651
table to be loaded into an
653
table, but will make the dump itself take considerably longer.
656
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
657
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
659
The password to use when connecting to the server. If you use the short option form (\fB\-p\fR), you
661
have a space between the option and the password. If you omit the
667
option on the command line, you are prompted for one.
669
Specifying a password on the command line should be considered insecure.
675
On Windows, connect to the server via a named pipe. This option applies only for connections to a local server, and only if the server supports named\-pipe connections.
678
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
679
\fB\-P \fR\fB\fIport_num\fR\fR
681
The TCP/IP port number to use for the connection.
684
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
686
The connection protocol to use for connecting to the server. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want.
692
This option is useful for dumping large tables. It forces
694
to retrieve rows for a table from the server a row at a time rather than retrieving the entire row set and buffering it in memory before writing it out.
697
\fB\-\-quote\-names\fR,
700
Quote database, table, and column names within
704
SQL mode is enabled, names are quoted within
706
characters. This option is enabled by default. It can be disabled with
707
\fB\-\-skip\-quote\-names\fR, but this option should be given after any option such as
710
\fB\-\-quote\-names\fR.
717
statements rather than
722
\fB\-\-result\-file=\fR\fB\fIfile_name\fR\fR,
723
\fB\-r \fR\fB\fIfile_name\fR\fR
725
Direct output to a given file. This option should be used on Windows to prevent newline
727
characters from being converted to
729
carriage return/newline sequences. The result file is created and its contents overwritten, even if an error occurs while generating the dump. The previous contents are lost.
735
Dump stored routines (procedures and functions) from the dumped databases. Use of this option requires the
739
table. The output generated by using
745
statements to re\-create the routines. However, these statements do not include attributes such as the routine creation and modification timestamps. This means that when the routines are reloaded, they will be created with the timestamps equal to the reload time.
747
If you require routines to be re\-created with their original timestamp attributes, do not use
748
\fB\-\-routines\fR. Instead, dump and reload the contents of the
750
table directly, using a drizzle account that has appropriate privileges for the
755
\fB\-\-set\-charset\fR
758
SET NAMES \fIdefault_character_set\fR
759
to the output. This option is enabled by default. To suppress the
762
\fB\-\-skip\-set\-charset\fR.
765
\fB\-\-single\-transaction\fR
769
SQL statement before dumping data from the server. It is useful only with transactional tables such as
770
InnoDB, because then it dumps the consistent state of the database at the time when
772
was issued without blocking any applications.
774
When using this option, you should keep in mind that only
778
tables are dumped in a consistent state. For example, any
782
tables dumped while using this option may still change state.
785
\fB\-\-single\-transaction\fR
786
dump is in process, to ensure a valid dump file (correct table contents and binary log position), no other connection should use the following statements:
790
TRUNCATE TABLE. A consistent read is not isolated from those statements, so use of them on a table to be dumped can cause the
794
to retrieve the table contents to obtain incorrect contents or fail.
797
\fB\-\-single\-transaction\fR
799
\fB\-\-lock\-tables\fR
800
option are mutually exclusive, because
802
causes any pending transactions to be committed implicitly.
804
To dump large tables, you should combine this option with
808
\fB\-\-skip\-comments\fR
810
See the description for the
817
See the description for the
822
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
823
\fB\-S \fR\fB\fIpath\fR\fR
826
localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use.
831
Options that begin with
833
specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates.
836
\fB\-\-tab=\fR\fB\fIpath\fR\fR,
837
\fB\-T \fR\fB\fIpath\fR\fR
839
Produce tab\-separated data files. For each dumped table,
842
\fI\fItbl_name\fR\fR\fI.sql\fR
843
file that contains the
845
statement that creates the table, and a
846
\fI\fItbl_name\fR\fR\fI.txt\fR
847
file that contains its data. The option value is the directory in which to write the files.
851
data files are formatted using tab characters between column values and a newline at the end of each line. The format can be specified explicitly using the
852
\fB\-\-fields\-\fR\fB\fIxxx\fR\fR
854
\fB\-\-lines\-terminated\-by\fR
857
Column values are dumped using the
859
character set and the
860
\fB\-\-default\-character\-set\fR
861
option is ignored. In effect, there is no character set conversion. If a table contains columns in several character sets, the output data file will as well and you may not be able to reload the file correctly.
864
.nr an-no-space-flag 1
868
This option should be used only when
870
is run on the same machine as the
872
server. You must have the
874
privilege, and the server must have permission to write files in the directory that you specify.
885
regards all name arguments following the option as table names.
890
Dump triggers for each dumped table. This option is enabled by default; disable it with
891
\fB\-\-skip\-triggers\fR.
898
columns to be dumped and reloaded between servers in different time zones.
900
sets its connection time zone to UTC and adds
901
SET TIME_ZONE='+00:00'
902
to the dump file. Without this option,
904
columns are dumped and reloaded in the time zones local to the source and destination servers, which can cause the values to change.
906
also protects against changes due to daylight saving time.
908
is enabled by default. To disable it, use
909
\fB\-\-skip\-tz\-utc\fR.
912
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
913
\fB\-u \fR\fB\fIuser_name\fR\fR
915
The drizzle user name to use when connecting to the server.
921
Verbose mode. Print more information about what the program does.
927
Display version information and exit.
930
\fB\-\-where='\fR\fB\fIwhere_condition\fR\fR\fB'\fR,
931
\fB\-w '\fR\fB\fIwhere_condition\fR\fR\fB'\fR
933
Dump only rows selected by the given
935
condition. Quotes around the condition are mandatory if it contains spaces or other characters that are special to your command interpreter.
941
\-\-where="user='jimf'"
951
Write dump output as well\-formed XML.
953
\fBNULL\fR\fB, \fR\fB'NULL'\fR\fB, and Empty Values\fR: For some column named
954
\fIcolumn_name\fR, the
956
value, an empty string, and the string value
958
are distinguished from one another in the output generated by this option as follows.
968
\fBXML Representation\fR:
971
NULL (\fIunknown value\fR)
973
<field name="\fIcolumn_name\fR"
977
\'' (\fIempty string\fR)
979
<field name="\fIcolumn_name\fR">
983
\'NULL' (\fIstring value\fR)
985
<field name="\fIcolumn_name\fR">
993
client when run using the
995
option also follows these rules. (See
996
the section called \(lq\fBMYSQL\fR OPTIONS\(rq.)
1000
includes the XML namespace, as shown here:
1004
shell> \fBdrizzledump \-\-xml \-u root world City\fR
1005
<?xml version="1.0"?>
1006
<drizzledump xmlns:xsi="http://www.w3.org/2001/XMLSchema\-instance">
1007
<database name="world">
1008
<table_structure name="City">
1009
<field Field="ID" Type="int(11)" Null="NO" Key="PRI" Extra="auto_increment" />
1010
<field Field="Name" Type="char(35)" Null="NO" Key="" Default="" Extra="" />
1011
<field Field="CountryCode" Type="char(3)" Null="NO" Key="" Default="" Extra="" />
1012
<field Field="District" Type="char(20)" Null="NO" Key="" Default="" Extra="" />
1013
<field Field="Population" Type="int(11)" Null="NO" Key="" Default="0" Extra="" />
1014
<key Table="City" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="ID" Collation="A" Cardinality="4079"
1015
Null="" Index_type="BTREE" Comment="" />
1016
<options Name="City" Engine="MyISAM" Version="10" Row_format="Fixed" Rows="4079" Avg_row_length="67" Data_length="27329
1017
3" Max_data_length="18858823439613951" Index_length="43008" Data_free="0" Auto_increment="4080" Create_time="2007\-03\-31 01:47:01" Updat
1018
e_time="2007\-03\-31 01:47:02" Collation="latin1_swedish_ci" Create_options="" Comment="" />
1020
<table_data name="City">
1022
<field name="ID">1</field>
1023
<field name="Name">Kabul</field>
1024
<field name="CountryCode">AFG</field>
1025
<field name="District">Kabol</field>
1026
<field name="Population">1780000</field>
1030
<field name="ID">4079</field>
1031
<field name="Name">Rafah</field>
1032
<field name="CountryCode">PSE</field>
1033
<field name="District">Rafah</field>
1034
<field name="Population">92020</field>
1045
You can also set the following variables by using
1046
\fB\-\-\fR\fB\fIvar_name\fR\fR\fB=\fR\fB\fIvalue\fR\fR
1052
The maximum size of the buffer for client/server communication. The maximum is 1GB.
1057
The initial size of the buffer for client/server communication. When creating multiple\-row\-insert statements (as with option
1058
\fB\-\-extended\-insert\fR
1064
length. If you increase this variable, you should also ensure that the
1066
variable in the drizzle server is at least this large.
1070
The most common use of
1072
is probably for making a backup of an entire database:
1076
shell> \fBdrizzledump \fR\fB\fIdb_name\fR\fR\fB > \fR\fB\fIbackup\-file.sql\fR\fR
1080
You can read the dump file back into the server like this:
1084
shell> \fBdrizzle \fR\fB\fIdb_name\fR\fR\fB < \fR\fB\fIbackup\-file.sql\fR\fR
1092
shell> \fBdrizzle \-e "source \fR\fB\fI/path\-to\-backup/backup\-file.sql\fR\fR\fB" \fR\fB\fIdb_name\fR\fR
1097
is also very useful for populating databases by copying data from one drizzle server to another:
1101
shell> \fBdrizzledump \-\-opt \fR\fB\fIdb_name\fR\fR\fB | drizzle \-\-host=\fR\fB\fIremote_host\fR\fR\fB \-C \fR\fB\fIdb_name\fR\fR
1105
It is possible to dump several databases with one command:
1109
shell> \fBdrizzledump \-\-databases \fR\fB\fIdb_name1\fR\fR\fB [\fR\fB\fIdb_name2\fR\fR\fB ...] > my_databases.sql\fR
1113
To dump all databases, use the
1114
\fB\-\-all\-databases\fR
1119
shell> \fBdrizzledump \-\-all\-databases > all_databases.sql\fR
1127
provides a way of making an online backup:
1131
shell> \fBdrizzledump \-\-all\-databases \-\-single\-transaction > all_databases.sql\fR
1135
This backup acquires a global read lock on all tables (using
1136
FLUSH TABLES WITH READ LOCK) at the beginning of the dump. As soon as this lock has been acquired, the binary log coordinates are read and the lock is released. If long updating statements are running when the
1138
statement is issued, the drizzle server may get stalled until those statements finish. After that, the dump becomes lock\-free and does not disturb reads and writes on the tables. If the update statements that the drizzle server receives are short (in terms of execution time), the initial lock period should not be noticeable, even with many updates.
1140
For point\-in\-time recovery (also known as
1141
\(lqroll\-forward,\(rq
1142
when you need to restore an old backup and replay the changes that happened since that backup), it is often useful to rotate the binary log , \(lqThe Binary Log\(rq) or at least know the binary log coordinates to which the dump corresponds:
1146
shell> \fBdrizzledump \-\-all\-databases \-\-master\-data=2 > all_databases.sql\fR
1154
shell> \fBdrizzledump \-\-all\-databases \-\-flush\-logs \-\-master\-data=2\fR
1155
\fB> all_databases.sql\fR
1160
\fB\-\-master\-data\fR
1162
\fB\-\-single\-transaction\fR
1163
options can be used simultaneously, which provides a convenient way to make an online backup suitable for point\-in\-time recovery if tables are stored using the
1167
If you encounter problems backing up views, please read the section that covers restrictions on views which describes a workaround for backing up views when this fails due to insufficient privileges.
1170
Copyright 2007\-2008 MySQL AB, 2009 Sun Microsystems, Inc.
1171
Copyright 2010 Drizzle Team
1173
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
1175
This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1177
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110\-1301 USA or see http://www.gnu.org/licenses/.
1179
For more information, please refer to http://www.drizzle.org/wiki.
1181
Sun Microsystems, Inc. (http://www.mysql.com/), Drizzle Team