-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
48 lines (40 loc) · 1.56 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Introduction
============
holland_restore is a simple python script to parse and filter mysqldump
output. This script currently supports:
* filtering by database, table and table-engine
* skipping routines
* skipping writing to the binary log on restore
Installing and some examples
============================
$ virtualenv test
$ . test/bin/activate
$ cd holland_restore
$ python setup.py develop
$ mysqlrestore < mydump.sql > mysqldump_copy.sql
Extract a few tables from a dump
--------------------------------
$ mysqlrestore --table mysql.user --table mysql.proc < mydump.sql > user_and_proc.sql
Extracting tables by storage engine
-----------------------------------
$ mysqlrestore --engine innodb < mydump.sql > innodb_tables.sql
Extracting only DDL (no table data)
-----------------------------------
$ mysqlrestore --no-data < mysqldump.sql > mydump_schema.sql
Combining options
-----------------
$ mysqlrestore --no-data --engine innodb --table employees.salaries < mydump.sql > custom.sql
Future features (or, it's all lies until there's code)
======================================================
* Rewrite database names, and skip USE database options
* Progress meter when piping into mysql
* More filtering options
Weird ideas
-----------
Rewriting mysqldump stream into other database formats (postgres,drizzle,etc.)
custom editing sections of a dump file, e.g.:
# [NOT IMPLEMENTED]
$ mysqlrestore --edit-ddl mydb.mytable
[fires up EDITOR when mydb.mytable is found in dump]
[replaces mydb.mytable in stream]
list table of contents of a dump (lines #'s and byte offsets)