]> git.phdru.name Git - sqlconvert.git/blob - docs/mysql2sql.rst
Update docs: mention /*! directives */
[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. It only
9 removes /\*! directives \*/ and passes everything else unmodified.
10
11
12 .. highlight:: none
13
14 Command line
15 ------------
16
17 mysql2sql
18 ~~~~~~~~~
19
20 Usage::
21
22     mysql2sql [-e encoding] [-E output_encoding] [infile] [[-o] outfile]
23
24 Options::
25
26     -e ENCODING, --encoding ENCODING
27                            input/output encoding, default is utf-8
28     -E OUTPUT_ENCODING, --output-encoding OUTPUT_ENCODING
29                            separate output encoding, default is the same as
30                            `-e` except for console; for console output charset
31                            from the current locale is used
32     -P, --no-pbar          Inhibit progress bar
33     infile                 Input file, stdin if absent or '-'
34     -o, --outfile outfile  Output file, stdout if absent or '-'
35
36 If stderr is connected to the console the program displays a text mode progress
37 bar. Option `-P/--no-pbar` inhibits it.
38
39 Option `-o` is useful when infile is absent (input is redirected), for
40 example::
41
42     mysql2sql -o outfile.sql < infile.sql
43     cat infile.sql | mysql2sql -o outfile.sql
44
45 But of course it simply can be::
46
47     mysql2sql - outfile.sql < infile.sql
48     cat infile.sql | mysql2sql - outfile.sql