1
Drizzledump Backup Tool
2
=======================
7
**drizzledump** [*OPTIONS*] *database* [*tables*]
9
**drizzledump** [*OPTIONS*] *--databases* [*OPTIONS*] *DB1* [*DB2* *DB3*...]
11
**drizzledump** [*OPTIONS*] *--all-databases* [*OPTIONS*]
16
:program:`drizzledump` is used for backing up and
17
restoring logical backups of a Drizzle database, as well as for migrating
20
When connecting to a Drizzle server it will do a plain dump of the server. It
21
will, however, automatically detect when it is connected to a *MySQL* server and
22
will convert the tables and data into a Drizzle compatible format.
24
Any binary data in tables will be converted into hexadecimal output so that it
25
does not corrupt the dump file.
30
The :program:`drizzledump` tool has several available options:
32
.. option:: -A, --all-databases
34
Dumps all databases found on the server apart from *information_schema* and
35
*data_dictionary* in Drizzle and *information_schema*, *performance_schema*
38
.. option:: -c, --complete-insert
40
Dumps using complete insert statements. *CURRENTLY BROKEN*
42
.. option:: -C, --compress
44
Use client/server compression protocol.
46
.. option:: -F, --flush-logs
48
Flush the server logs before commencing with the dump. *CURRENTLY_BROKEN*
50
.. option:: -f, --force
52
Continue even if we get an sql-error. *CURRENTLY_BROKEN*
54
.. option:: -?, --help
56
Show a message with all the available options.
58
.. option:: -x, --lock-all-tables
60
Locks all the tables for all databases with a global read lock. The lock is
61
released automatically when :program:`drizzledump` ends.
62
Turns on :option:`--single-transaction` and :option:`--lock-tables`.
64
.. option:: --single-transaction
66
Creates a consistent snapshot by dumping the tables in a single transaction.
67
During the snapshot no other connected client should use any of the
68
following as this will implicitly commit the transaction and prevent the
76
Only works with InnoDB. Automatically disables :option:`--lock-tables`.
78
.. option:: --disable-opt
80
A shortcut for :option:`--skip-drop-table`, :option:`--skip-locks`,
81
:option:`--skip-create`, :option:`--slow`, :option:`--skip-extended-insert`
82
and :option:`--skip-disable-keys`
84
.. option:: --tables t1 t2 ...
86
Dump a list of tables.
88
.. option:: --show-progress-size rows (=10000)
90
Show progress of the dump every *rows* of the dump. Requires
93
.. option:: -v, --verbose
95
Sends various verbose information to stderr as the dump progresses.
97
.. option:: --skip-create
99
Do not dump the CREATE TABLE / CREATE DATABASE statements.
101
.. option:: --skip-extended-insert
103
Dump every row on an individual line. For example::
105
INSERT INTO `t1` VALUES (1,'hello');
106
INSERT INTO `t1` VALUES (2,'world');
108
.. option:: --skip-dump-date
110
Do not display the date/time at the end of the dump.
112
.. option:: --no-defaults
114
Do not attempt to read configuration from configuration files.
116
.. option:: --add-drop-database
118
Add `DROP DATABASE` statements before `CREATE DATABASE`.
120
.. option:: --compact
122
Gives a more compact output by disabling header/footer comments and enabling
123
:option:`--skip-add-drop-table`, :option:`--no-set-names`,
124
:option:`--skip-disable-keys` and :option:`--skip-add-locks`.
126
.. option:: -B, --databases
128
Dump several databases. The databases do not need to follow on after this
129
option, they can be anywhere in the command line.
131
.. option:: --insert-ignore
133
Add the `IGNORE` keyword into every `INSERT` statement.
135
.. option:: --no-autocommit
137
Make the dump of each table a single transaction by wrapping it in `COMMIT`
140
.. option:: -n, --no-create-db
142
Do not output the `CREATE DATABASE` statements when using
143
:option:`--all-databases` or :option:`--databases`.
145
.. option:: -d, --no-data
147
Do not dump the data itself, used to dump the schemas only.
151
Dump directly from database to destination rather than using a query buffer.
153
.. option:: --replace
155
Use `REPLACE INTO` statements instead of `INSERT INTO`
157
.. option:: --destination-type type (=stdout)
159
Destination of the data.
162
The default. Output to the command line
165
Connect to another database and pipe data to that.
167
.. versionadded:: 2010-09-27
169
.. option:: --destination-host hostname (=localhost)
171
The hostname for the destination database. Requires
172
:option:`--destination-type` `= database`
174
.. versionadded:: 2010-09-27
176
.. option:: --destination-port port (=3306)
178
The port number for the destination database. Requires
179
:option:`--destination-type` `= database`
181
.. versionadded:: 2010-09-27
183
.. option:: --destination-user username
185
The username for the destinations database. Requires
186
:option:`--destination-type` `= database`
188
.. versionadded:: 2010-09-27
190
.. option:: --destination-password password
192
The password for the destination database. Requires
193
:option:`--destination-type` `= database`
195
.. versionadded:: 2010-09-27
197
.. option:: --destination-database database
199
The database for the destination database, for use when only dumping a
200
single database. Requires
201
:option:`--destination-type` `= database`
203
.. versionadded:: 2010-09-27
205
.. option:: -h, --host hostname (=localhost)
207
The hostname of the database server.
209
.. option:: -u, --user username
211
The username for the database server.
213
.. option:: -P, --password password
215
The password for the database server.
217
.. option:: -p, --port port (=3306,4427)
219
The port number of the database server. Defaults to 3306 for MySQL protocol
220
and 4427 for Drizzle protocol.
222
.. option:: --protocol protocol (=mysql)
224
The protocol to use when connecting to the database server. Options are:
227
The standard MySQL protocol.
230
The Drizzle protocol.
232
Backups using Drizzledump
233
-------------------------
235
Backups of a database can be made very simply by running the following::
237
$ drizzledump --all-databases > dumpfile.sql
239
This can then be re-imported into drizzle at a later date using::
241
$ drizzle < dumpfile.sql
243
MySQL Migration using Drizzledump
244
---------------------------------
246
As of version 2010-09-27 there is the capability to migrate databases from
247
MySQL to Drizzle using :program:`drizzledump`.
249
:program:`drizzledump` will automatically detect whether it is talking to a
250
MySQL or Drizzle database server. If it is connected to a MySQL server it will
251
automatically convert all the structures and data into a Drizzle compatible
254
So, simply connecting to a MySQL server with :program:`drizzledump` as follows
255
will give you a Drizzle compatible output::
257
$ drizzledump --all-databases --host=mysql-host --user=mysql-user --password > dumpfile.sql
259
Additionally :program:`drizzledump` can now dump from MySQL and import directly
260
into a Drizzle server as follows::
262
$ drizzledump --all-databases --host=mysql-host --user=mysql-user --password --destination-type=database --desination-host=drizzle-host