88
88
.. option:: --skip-extended-insert
90
Dump every row on an individual line. For example::
90
Dump every row on an individual line. For example:
92
94
INSERT INTO `t1` VALUES (1,'hello');
93
95
INSERT INTO `t1` VALUES (2,'world');
243
245
Backups using Drizzledump
244
246
-------------------------
246
Backups of a database can be made very simply by running the following::
248
$ drizzledump --all-databases > dumpfile.sql
250
This can then be re-imported into drizzle at a later date using::
252
$ drizzle < dumpfile.sql
248
Backups of a database can be made very simply by running the following:
252
$ drizzledump --all-databases > dumpfile.sql
254
This can then be re-imported into drizzle at a later date using:
258
$ drizzle < dumpfile.sql
254
260
MySQL Migration using Drizzledump
255
261
---------------------------------
260
266
:program:`drizzledump` will automatically detect whether it is talking to a
261
267
MySQL or Drizzle database server. If it is connected to a MySQL server it will
262
268
automatically convert all the structures and data into a Drizzle compatible
263
format. It will, however, by default try to connect via. port 4427 so to
264
connect to a MySQL server a port must be specified.
273
:program:`drizzledump` will by default try to connect via. port 4427 so to
274
connect to a MySQL server a port (such as 3306) must be specified.
266
276
So, simply connecting to a MySQL server with :program:`drizzledump` as follows
267
will give you a Drizzle compatible output::
269
$ drizzledump --all-databases --host=mysql-host --port=3306 --user=mysql-user --password > dumpfile.sql
277
will give you a Drizzle compatible output:
281
$ drizzledump --all-databases --host=mysql-host --port=3306 --user=mysql-user --password > dumpfile.sql
271
283
Additionally :program:`drizzledump` can now dump from MySQL and import directly
272
into a Drizzle server as follows::
274
$ drizzledump --all-databases --host=mysql-host --port=3306 --user=mysql-user --password --destination-type=database --desination-host=drizzle-host
276
Please take special note of :ref:`old-passwords-label` if you have connection
277
issues from :program:`drizzledump` to your MySQL server.
279
If you find your VARCHAR and TEXT data does not look correct in a drizzledump
280
output, it is likely that you have UTF8 data stored in a non-UTF8 table. In
281
which case please check the :option:`--my-data-is-mangled` option.
284
into a Drizzle server as follows:
288
$ drizzledump --all-databases --host=mysql-host --port=3306 --user=mysql-user --password --destination-type=database --desination-host=drizzle-host
292
Please take special note of :ref:`old-passwords-label` if you have connection
293
issues from :program:`drizzledump` to your MySQL server.
296
If you find your VARCHAR and TEXT data does not look correct in a drizzledump
297
output, it is likely that you have UTF8 data stored in a non-UTF8 table. In
298
which case please check the :option:`--my-data-is-mangled` option.
283
300
When you migrate from MySQL to Drizzle, the following conversions are required:
294
311
* tinyblob -> blob
295
312
* mediumblob -> blob
296
313
* longblob -> blob
297
* time -> int (of seconds)
300
* date/datetime default 0000-00-00 -> default NULL (Currently, ALL date columns have their DEFAULT set to NULL on migration)
301
* date/datetime NOT NULL columns -> NULL
302
* any date data containing 0000-00-00 -> NULL
303
* TIME -> INT of the number of seconds*
304
* enum-> DEFAULT NULL
306
* This prevents data loss since MySQL's TIME data type has a range of -838:59:59 - 838:59:59, and Drizzle's TIME type has a range of 00:00:00 - 23:59:61.999999.
316
* date/datetime default 0000-00-00 -> default NULL [2]_
317
* date/datetime NOT NULL columns -> NULL [2]_
318
* any date data containing 0000-00-00 -> NULL [2]_
319
* time -> int of the number of seconds [3]_
320
* enum-> DEFAULT NULL [4]_
322
.. rubric:: Footnotes
324
.. [1] There is currently no good alternative to SET, this is simply to preserve
325
the data in the column. There is a new alternative to SET to be included
328
.. [2] Currently, ALL date columns have their DEFAULT set to NULL on migration.
329
This is so that any rows with 0000-00-00 dates can convert to NULL.
331
.. [3] This prevents data loss since MySQL's TIME data type has a range of
332
-838:59:59 - 838:59:59, and Drizzle's TIME type has a range of
335
.. [4] This is so that empty entries such as '' will convert to NULL.