{"id":18677951,"url":"https://github.com/vrerv/mysql-db-tool","last_synced_at":"2026-05-01T18:32:24.941Z","repository":{"id":251866788,"uuid":"838679535","full_name":"vrerv/mysql-db-tool","owner":"vrerv","description":"A ruby script tool for backing up and restoring MySQL data.","archived":false,"fork":false,"pushed_at":"2025-06-05T06:15:30.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T16:52:10.688Z","etag":null,"topics":["backup","mysql","restore"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/vrerv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-06T06:15:19.000Z","updated_at":"2025-06-05T06:15:21.000Z","dependencies_parsed_at":"2024-11-07T09:37:51.869Z","dependency_job_id":"d0d56ac7-ec6a-401f-9b29-80645d1e4a77","html_url":"https://github.com/vrerv/mysql-db-tool","commit_stats":null,"previous_names":["vrerv/mysql-db-tool"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/vrerv/mysql-db-tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vrerv%2Fmysql-db-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vrerv%2Fmysql-db-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vrerv%2Fmysql-db-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vrerv%2Fmysql-db-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vrerv","download_url":"https://codeload.github.com/vrerv/mysql-db-tool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vrerv%2Fmysql-db-tool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32508901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["backup","mysql","restore"],"created_at":"2024-11-07T09:35:33.342Z","updated_at":"2026-05-01T18:32:24.916Z","avatar_url":"https://github.com/vrerv.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MySQL Backup \u0026 Restore Tool\n\n[🇰🇷 (한국어)](./README_KO.md) | [🇬🇧 (English)](./README.md)\n\nA ruby script tool for backing up and restoring MySQL data.\n\n## Requirements\n\n* Tested on linux, Mac OS X environments only\n* ruby, mysql, mysqldump, gzip, zcat commands must be installed\n\n## Configuration\n\nCreate a config-\u003cenv\u003e.json file under the current directory according to the database environment.\n\n```json\n{\n  \"dataTables\": [],\n  \"ignoreTables\": [],\n  \"dbInfo\": {\n    \"host\": \"localhost\",\n    \"port\": 3306,\n    \"user\": \"root\",\n    \"password\": \"\",\n    \"database\": [\n      \"test_db\"\n    ]\n  }\n}\n```\n\n* dataTables - allows you to set a column for putting a --where condition to backup only the latest(3 days) rows of a large table.\n    * { \"name\": \"table_name\", \"where\": \"column_name\" }\n* ignoreTables - allows you to set which tables should be excluded from backups as unused tables.\n\n## Install\n\n```shell\ngem install mysql_db_tool\n```\n\n[Example script](docs/examples.md)\n\n## Data backup\n\n```shell\nmysql_backup -e {env} -i {backup id} -r {run?} --gzip\n```\n\nyou can get help by running `mysql_backup -h`\n\n* env - default (local), key to find the configuration file. e.g.) config-local.json\n* backup id - default (0), ID to use when restoring as a string\n* run? - Default (false), you can check in advance which command will be executed, if true, it will be executed\n* gzip? - default (true), whether to compress with gzip or not\n\n* DUMP_OPTIONS - you can set common mysqldump command options by this Environment variable,\n  if not set, it will use default options for mysqldump. (--single-transaction --skip-lock-tables --no-tablespaces)\n\nAfter execution, a directory named \"backup-{backup id}\" will be created under the current directory.\n\n## restore backup data\n\n```shell\nmysql_restore -e {env} -i {backup id} -r {run?} --drop-all-tables\n```\n\nyou can get help by running `mysql_restore -h`\n\n* drop all tables? - Default (false), to keep existing tables, or true, which may cause integration check error if not set to true\n\n## Generate creating db and user sql\n\nYou can generate a sql script to create a db and user.\n\n```shell\ngen_create_db_user {user} {password} {db} {host}\n```\n\n## Installing Ruby\n\nYou can use OS default ruby if it is already installed.\n\nBelow is additional steps to install or develop with the latest version of Ruby.\n\nInstall using `rbenv` on Mac OS X\n\n```bash\nbrew install rbenv\nrbenv init\nrbenv install 3.3.0\nrbenv global 3.3.0\nruby -v\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvrerv%2Fmysql-db-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvrerv%2Fmysql-db-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvrerv%2Fmysql-db-tool/lists"}