{"id":14972068,"url":"https://github.com/kedarvj/mysqldumpsplitter","last_synced_at":"2025-04-04T20:14:43.274Z","repository":{"id":17856389,"uuid":"20779314","full_name":"kedarvj/mysqldumpsplitter","owner":"kedarvj","description":"MySQL Dump splitter to split / extract databases \u0026 tables from mysqldump","archived":false,"fork":false,"pushed_at":"2023-07-27T13:20:34.000Z","size":55,"stargazers_count":527,"open_issues_count":13,"forks_count":133,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-03-28T19:09:40.618Z","etag":null,"topics":["dump-splitter","extract-databases","extract-tables","mysql","mysql-database","mysql-database-backup","mysqldump"],"latest_commit_sha":null,"homepage":"http://kedar.nitty-witty.com/blog","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kedarvj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-06-12T18:58:46.000Z","updated_at":"2025-02-26T14:35:12.000Z","dependencies_parsed_at":"2023-01-11T19:42:42.933Z","dependency_job_id":"455bd667-e2dd-4831-83a3-703b5372b15b","html_url":"https://github.com/kedarvj/mysqldumpsplitter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kedarvj%2Fmysqldumpsplitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kedarvj%2Fmysqldumpsplitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kedarvj%2Fmysqldumpsplitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kedarvj%2Fmysqldumpsplitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kedarvj","download_url":"https://codeload.github.com/kedarvj/mysqldumpsplitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242680,"owners_count":20907134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dump-splitter","extract-databases","extract-tables","mysql","mysql-database","mysql-database-backup","mysqldump"],"created_at":"2024-09-24T13:46:20.447Z","updated_at":"2025-04-04T20:14:43.253Z","avatar_url":"https://github.com/kedarvj.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mysqldumpsplitter - MySQL Dump splitter to split / extract databases, tables, list from mysqldump with plenty of more funtionality.\n\n\n### Usage:\n\nDownload the utility from [website](http://kedar.nitty-witty.com/blog) or git repository.\n\u003chr\u003e\n\t************ Usage ************ \n\nsh mysqldumpsplitter.sh --source filename --desc --extract [DB|TABLE|DBTABLES|ALLDBS|ALLTABLES|REGEXP] --match_str string --compression [gzip|pigz|bzip2|none] --decompression [gzip|pigz|bzip2|none] --output_dir [path to output dir] [--config /path/to/config] \n                                                    \n\u003ch4\u003eOptions:\u003c/h4\u003e\n                                                    \n\t--source: mysqldump filename to process. It could be a compressed or regular file.\n\t--desc: This option will list out all databases and tables.\n\t--extract: Specify what to extract. Possible values DB, TABLE, ALLDBS, ALLTABLES, REGEXP\n\t--match_str: Specify match string for extract command option.\n\t--compression: gzip/pigz/bzip2/none (default: gzip). Extracted file will be of this compression.\n\t--decompression: gzip/pigz/bzip2/none (default: gzip). This will be used against input file.\n\t--output_dir: path to output dir. (default: ./out/)\n\t--config: path to config file. You may use --config option to specify the config file that includes following variables.\n\t\tSOURCE=\n\t\tEXTRACT=\n\t\tCOMPRESSION=\n\t\tDECOMPRESSION=\n\t\tOUTPUT_DIR=\n\t\tMATCH_STR=\n\n                                                    \nVer. 5.0\n\u003chr\u003e\n\n\n### mysqldumpsplitter recipe:\n\n1) Extract single database from mysqldump:\n\n`sh mysqldumpsplitter.sh --source filename --extract DB --match_str database-name`\n\nAbove command will create sql for specified database from specified \"filename\" sql file and store it in compressed format to database-name.sql.gz. \n\n2) Extract single table from mysqldump:\n\n`sh mysqldumpsplitter.sh --source filename --extract TABLE --match_str table-name`\n\nAbove command will create sql for specified table from specified \"filename\" mysqldump file and store it in compressed format to database-name.sql.gz.\n \n\n3) Extract tables matching regular expression from mysqldump:\n\n`sh mysqldumpsplitter.sh --source filename --extract REGEXP --match_str regular-expression`\n\nAbove command will create sqls for tables matching specified regular expression from specified \"filename\" mysqldump file and store it in compressed format to individual table-name.sql.gz.\n\n\n4) Extract all databases from mysqldump:\n\n`sh mysqldumpsplitter.sh --source filename --extract ALLDBS`\n\nAbove command will extract all databases from specified \"filename\" mysqldump file and store it in compressed format to individual database-name.sql.gz.\n\n\n5) Extract all table from mysqldump:\n\n`sh mysqldumpsplitter.sh --source filename --extract ALLTABLES`\n\nAbove command will extract all tables from specified \"filename\" mysqldump file and store it in compressed format to individual table-name.sql.gz.\n\n\n6) Extract list of tables from mysqldump:\n\n`sh mysqldumpsplitter.sh --source filename --extract REGEXP --match_str '(table1|table2|table3)'`\n\nAbove command will extract tables from the specified \"filename\" mysqldump  file and store them in compressed format to individual table-name.sql.gz.\n\n7) Extract a database from compressed mysqldump:\n\n`sh mysqldumpsplitter.sh --source filename.sql.gz --extract DB --match_str 'dbname' --decompression gzip`\n\nAbove command will decompress filename.sql.gz using gzip, extract database named \"dbname\" from \"filename.sql.gz\" \u0026 store it as out/dbname.sql.gz\n\n\n8) Extract a database from compressed mysqldump in an uncompressed format:\n\n`sh mysqldumpsplitter.sh --source filename.sql.gz --extract DB --match_str 'dbname' --decompression gzip --compression none`\n\nAbove command will decompress filename.sql.gz using gzip and extract database named \"dbname\" from \"filename.sql.gz\" \u0026 store it as plain sql out/dbname.sql\n\n\n9) Extract alltables from mysqldump in different folder:\n\n`sh mysqldumpsplitter.sh --source filename --extract ALLTABLES --output_dir /path/to/extracts/`\n\nAbove command will extract all tables from specified \"filename\" mysqldump file and extracts tables in compressed format to individual files, table-name.sql.gz stored under /path/to/extracts/.\nThe script will create the folder /path/to/extracts/ if not exists.\n\n\n10) Extract one or more tables from one database in a full-dump:\n\nConsider you have a full dump with multiple databases and you want to extract few tables from one database.\n\n\tExtract single database:\n\t`sh mysqldumpsplitter.sh --source filename --extract DB --match_str DBNAME --compression none`\n\n\tExtract all tables\n\t`sh mysqldumpsplitter.sh --source out/DBNAME.sql --extract REGEXP --match_str \"(tbl1|tbl2)\"`\n\nthough we can use another option to do this in single command as follows:\n\n`sh mysqldumpsplitter.sh --source filename --extract DBTABLE --match_str \"DBNAME.(tbl1|tbl2)\" --compression none`\n\nAbove command will extract both tbl1 and tbl2 from DBNAME database in sql format under folder \"out\" in current directory.\n\nYou can extract single table as follows:\n\n`sh mysqldumpsplitter.sh --source filename --extract DBTABLE --match_str \"DBNAME.(tbl1)\" --compression none`\n \n11) Extract all tables from specific database:\n\n`mysqldumpsplitter.sh --source filename --extract DBTABLE --match_str \"DBNAME.*\" --compression none`\n\nAbove command will extract all tables from DBNAME database in sql format and store it under \"out\" directory.\n\n\n12) List content of the mysqldump file\n\n`mysqldumpsplitter.sh --source filename --desc`\n\nAbove command will list databases and tables from the dump file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkedarvj%2Fmysqldumpsplitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkedarvj%2Fmysqldumpsplitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkedarvj%2Fmysqldumpsplitter/lists"}