{"id":24149353,"url":"https://github.com/andromedarabbit/mysqldump-async","last_synced_at":"2025-07-25T05:07:48.467Z","repository":{"id":34606883,"uuid":"38555164","full_name":"andromedarabbit/mysqldump-async","owner":"andromedarabbit","description":"A simple wrapper to execute mysqldump asynchronously","archived":false,"fork":false,"pushed_at":"2019-03-06T02:10:42.000Z","size":23,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-12T08:38:10.958Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andromedarabbit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-05T03:17:04.000Z","updated_at":"2019-03-06T02:10:44.000Z","dependencies_parsed_at":"2022-07-15T17:30:35.084Z","dependency_job_id":null,"html_url":"https://github.com/andromedarabbit/mysqldump-async","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andromedarabbit%2Fmysqldump-async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andromedarabbit%2Fmysqldump-async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andromedarabbit%2Fmysqldump-async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andromedarabbit%2Fmysqldump-async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andromedarabbit","download_url":"https://codeload.github.com/andromedarabbit/mysqldump-async/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241398377,"owners_count":19956719,"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":[],"created_at":"2025-01-12T08:38:14.071Z","updated_at":"2025-03-01T17:24:14.146Z","avatar_url":"https://github.com/andromedarabbit.png","language":"JavaScript","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=VG4JMPL7SDBGG\u0026lc=KR\u0026item_name=andromedarabbit%2fmybatis%2dpagination\u0026item_number=mybatis%2dpagination\u0026currency_code=USD\u0026bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted"],"categories":[],"sub_categories":[],"readme":"[![PayPal](https://img.shields.io/badge/%24-paypal-f39c12.svg)][paypal-donations]\n[![](https://images.microbadger.com/badges/image/andromedarabbit/mysqldump-async.svg)](https://microbadger.com/images/andromedarabbit/mysqldump-async \"Get your own image badge on microbadger.com\")\n[![](https://images.microbadger.com/badges/version/andromedarabbit/mysqldump-async.svg)](https://microbadger.com/images/andromedarabbit/mysqldump-async \"Get your own version badge on microbadger.com\")\n\n# mysqldump-async\n\n[mysqldump-async](https://github.com/andromedarabbit/mysqldump-async) is the simple wrapper to execute `mysqldump` asynchronously and dump multiple tables *in parallel*.\n\n* Not as fast as a binary dump but **super-fast** comparing to running `mysqldump` in a single command.\n* Designed to be a good tool when you want to **version control** you database schemes and records.\n\n## Using Docker\n\nAll the files you needs are in the directory `examples`:\n\n* `dump.sh`\n* `restore.sh`\n\nEdit the configuration file `info.js` before you run the scripts to dump or restore the database.\n\n## On Your Mac\n\n### Prerequites\n#### `mysqldump`\n`mysqldump` should be installed first. Recommend to use [Homebrew](http://brew.sh/) to install it if you are a Mac user:\n\n```bash\nbrew install mysql\n```\n\n`mysqldump` binary is expected to in `${PATH}`.\n\n#### `node` packages\nRun `npm install` on your `mysqldump-async` folder. All the node.js packages will be installed. Of course, `node` and `npm` is required. Use Homebrew to install both of `node` and `npm` if you are a Mac user:\n\n```bash\nbrew install node\n```\n\n### Configurations\nYou can find all the configurations you need from `info.js`:\n\n```javascript\nvar dropAndCreate = true;\nvar backupBeforeDrop = false;\n\nvar dumpRootDir = path.join(__dirname, \"dumps\");\n\nvar mysqlPath = which('mysql').stdout;\nvar mysqldumpPath = which('mysqldump').stdout;\n\nvar backupRootDir = path.join(toolbox_js.getHomeDir(), '.backup');\n\nvar serverAddress = 'localhost';\n\nvar servers = [];\n```\n\n`servers` is the most important configurations and should be filled before using this tool. See the following examples:\n\n```javascript\nvar servers = [\n    {\"name\": \"primary-database\", \"hostname\": serverAddress, \"port\": \"3306\", \"username\": \"root\", \"password\": \"PASSWORD\", \"database\": \"db_service\", \"tables\" : {\n         \"require\": [\n                 \"users\",\n                 ],\n         \"clear\": [\n                \"audits\",\n                ]\n        },\n        \"before\" : path.join(dumpRootDir, \"primary-database.db_service.prerequites.sql\") ,\n\n    },\n    {\"name\": \"schedule-database\", \"hostname\": serverAddress, \"port\": \"3306\", \"username\": \"root\", \"password\": \"PASSWORD\", \"database\": \"db_schedule\", \"tables\" : {\n        \"require\": [\n                 \"SCHEDULE_BLOB_TRIGGERS\" ,\n                 \"SCHEDULE_CALENDARS\" ,\n                 \"SCHEDULE_CRON_TRIGGERS\" ,\n                 \"SCHEDULE_FIRED_TRIGGERS\" ,\n                 \"SCHEDULE_JOB_DETAILS\" ,\n                 \"SCHEDULE_JOB_LISTENERS\" ,\n                 \"SCHEDULE_LOCKS\" ,\n                 \"SCHEDULE_PAUSED_TRIGGER_GRPS\" ,\n                 \"SCHEDULE_SIMPLE_TRIGGERS\" ,\n                 \"SCHEDULE_TRIGGERS\" ,\n                 \"SCHEDULE_TRIGGER_LISTENERS\" ,\n                 \"BATCH_JOB_EXECUTION_SEQ\" ,\n                 \"BATCH_JOB_SEQ\" ,\n                 \"BATCH_STEP_EXECUTION_SEQ\" ,\n                ],\n        \"clear\": [\n               \"SCHEDULE_SCHEDULER_STATE\",\n               \"BATCH_JOB_EXECUTION\",\n               \"BATCH_JOB_EXECUTION_CONTEXT\",\n               \"BATCH_JOB_EXECUTION_PARAMS\",\n               \"BATCH_JOB_INSTANCE\",\n               \"BATCH_STEP_EXECUTION\",\n               \"BATCH_STEP_EXECUTION_CONTEXT\"\n               ]\n\n        },\n        \"before\" : path.join(dumpRootDir, \"schedule-database.db_schedule.prerequites.sql\") ,\n    },\n\n];\n```\n\n### How to dump and restore the dump databases\nRun `dump.js.command` to dump your databases and then you can find your dump files from `dumpRootDir` directory:\n\n```javascript\nvar dumpRootDir = path.join(__dirname, \"dumps\");\n```\n\nRun `restore.js.command` to restore the databases using your dump files. Any changes made on your database will be discarded if you do not dump the database before restoring it. Set `backupBeforeDrop` to `true` if you want to dump the database first before restoring it.\n\n```javascript\nvar backupBeforeDrop = false;\n```\n\n\n[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=VG4JMPL7SDBGG\u0026lc=KR\u0026item_name=andromedarabbit%2fmybatis%2dpagination\u0026item_number=mybatis%2dpagination\u0026currency_code=USD\u0026bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandromedarabbit%2Fmysqldump-async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandromedarabbit%2Fmysqldump-async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandromedarabbit%2Fmysqldump-async/lists"}