~clint-fewbar/drizzle/authorize-default-deny

« back to all changes in this revision

Viewing changes to docs/clients/drizzledump.rst

  • Committer: Lee Bieber
  • Date: 2011-02-16 14:48:10 UTC
  • mfrom: (2172.1.5 build)
  • Revision ID: kalebral@gmail.com-20110216144810-u3w6f3a5s6qwisrz
Merge Stewart - remove unused macros
Merge Olaf - remove old style casts
Merge Stewart remove  unused macros in drizzledump
Merge Andrew - 718657: Several errors in Date/Time docs
Merge Olaf - Move strfunc functions into TYPELIB class

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
 
88
88
.. option:: --skip-extended-insert
89
89
 
90
 
Dump every row on an individual line.  For example::
 
90
Dump every row on an individual line.  For example:
 
91
 
 
92
.. code-block:: mysql
91
93
 
92
94
        INSERT INTO `t1` VALUES (1,'hello');
93
95
        INSERT INTO `t1` VALUES (2,'world');
243
245
Backups using Drizzledump
244
246
-------------------------
245
247
 
246
 
Backups of a database can be made very simply by running the following::
247
 
 
248
 
$ drizzledump --all-databases > dumpfile.sql
249
 
 
250
 
This can then be re-imported into drizzle at a later date using::
251
 
 
252
 
$ drizzle < dumpfile.sql
 
248
Backups of a database can be made very simply by running the following:
 
249
 
 
250
.. code-block:: bash
 
251
 
 
252
  $ drizzledump --all-databases > dumpfile.sql
 
253
 
 
254
This can then be re-imported into drizzle at a later date using:
 
255
 
 
256
.. code-block:: bash
 
257
 
 
258
  $ drizzle < dumpfile.sql
253
259
 
254
260
MySQL Migration using Drizzledump
255
261
---------------------------------
268
274
   connect to a MySQL server a port (such as 3306) must be specified.
269
275
 
270
276
So, simply connecting to a MySQL server with :program:`drizzledump` as follows
271
 
will give you a Drizzle compatible output::
272
 
 
273
 
$ drizzledump --all-databases --host=mysql-host --port=3306 --user=mysql-user --password > dumpfile.sql
 
277
will give you a Drizzle compatible output:
 
278
 
 
279
.. code-block:: bash
 
280
 
 
281
  $ drizzledump --all-databases --host=mysql-host --port=3306 --user=mysql-user --password > dumpfile.sql
274
282
 
275
283
Additionally :program:`drizzledump` can now dump from MySQL and import directly
276
 
into a Drizzle server as follows::
277
 
 
278
 
$ drizzledump --all-databases --host=mysql-host --port=3306 --user=mysql-user --password --destination-type=database --desination-host=drizzle-host
 
284
into a Drizzle server as follows:
 
285
 
 
286
.. code-block:: bash
 
287
 
 
288
  $ drizzledump --all-databases --host=mysql-host --port=3306 --user=mysql-user --password --destination-type=database --desination-host=drizzle-host
279
289
 
280
290
.. note::
281
291
 
302
312
 * mediumblob -> blob
303
313
 * longblob -> blob
304
314
 * year -> int
305
 
 * set -> text
306
 
 * date/datetime default 0000-00-00 -> default NULL (Currently, ALL date columns have their DEFAULT set to NULL on migration)
307
 
 * date/datetime NOT NULL columns -> NULL
308
 
 * any date data containing 0000-00-00 -> NULL
309
 
 * time -> int of the number of seconds [1]_
310
 
 * enum-> DEFAULT NULL
 
315
 * set -> text [1]_
 
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]_
311
321
 
312
322
.. rubric:: Footnotes
313
323
 
314
 
.. [1] This prevents data loss since MySQL's TIME data type has a range of
 
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
 
326
       at a later date.
 
327
 
 
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.
 
330
 
 
331
.. [3] This prevents data loss since MySQL's TIME data type has a range of
315
332
       -838:59:59 - 838:59:59, and Drizzle's TIME type has a range of
316
 
       00:00:00 - 23:59:61.999999.
 
333
       00:00:00 - 23:59:59.
 
334
 
 
335
.. [4] This is so that empty entries such as '' will convert to NULL.