]> git.phdru.name Git - sqlconvert.git/blob - docs/mysql2sql.rst
Fix docs after split index -> mysql2sql
[sqlconvert.git] / docs / mysql2sql.rst
1 mysql2sql
2 =========
3
4 This is mysql2sql, a mysql to sql converter. It is primary intended to
5 convert mysqldump (especially with extended INSERT syntax) to standard
6 SQL to load at least to PostgreSQL or SQLite.
7
8 The program is in its initial phase and currently cannot do much.
9
10 .. highlight:: none
11
12 Command line
13 ------------
14
15 mysql2sql
16 ~~~~~~~~~
17
18 Usage::
19
20     mysql2sql [-e encoding] [-E output_encoding] [infile] [[-o] outfile]
21
22 Options::
23
24     -e ENCODING, --encoding ENCODING
25                            input/output encoding, default is utf-8
26     -E OUTPUT_ENCODING, --output-encoding OUTPUT_ENCODING
27                            separate output encoding, default is the same as
28                            `-e` except for console; for console output charset
29                            from the current locale is used
30     -P, --no-pbar          Inhibit progress bar
31     infile                 Input file, stdin if absent or '-'
32     -o, --outfile outfile  Output file, stdout if absent or '-'
33
34 If stderr is connected to the console the program displays a text mode progress
35 bar. Option `-P/--no-pbar` inhibits it.
36
37 Option `-o` is useful when infile is absent (input is redirected), for
38 example::
39
40     mysql2sql -o outfile.sql < infile.sql
41     cat infile.sql | mysql2sql -o outfile.sql
42
43 But of course it simply can be::
44
45     mysql2sql - outfile.sql < infile.sql
46     cat infile.sql | mysql2sql - outfile.sql