Skip to content

Scoopit/mysqldump-splitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mysqldump-splitter

Split gigantic mysql dumps into smaller one in a human manageable directory structure.

Output files can be optionally be compressed (gzip).

Installation

This tool is not yet published to crates.io.

cargo install --git https://github.com/Scoopit/mysqldump-splitter.git

Usage

USAGE:
    mysqldump-splitter [OPTIONS] --output <OUTPUT>

OPTIONS:
    -c, --compress
            Compress each output file.

            Output .gz gzipped compressed files instead of plain text .sql files

    -h, --help
            Print help information

    -i, --input <INPUT>
            Read this file instead of the standard input

    -o, --output <OUTPUT>
            Output directory

    -V, --version
            Print version information

Directory structure

The first lines of the dump, before any database creation or table creation is output to:

{output_dir}/00_header.sql

Create database & use statements are output in

{output_dir}/{db}/00_create_database.sql

Each table is output in the following file if a database has been created before:

{output_dir}/{db}/{table_name}.sql

If no database creation is present in the dump, tables are output to:

{output_dir}/{table_name}.sql

If the compress flag is set, all files are gzipped and .gz extension is appended to their name.

Known Issues

  • procedures or triggers are appended to the last table of a database
  • comments do not match files (eg. the create database file contains comments for the first table in the db)

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages