{"id":29363028,"url":"https://github.com/patternhelloworld/docker-my-sql-replica","last_synced_at":"2025-09-05T13:39:07.861Z","repository":{"id":97361728,"uuid":"462775849","full_name":"patternhelloworld/docker-my-sql-replica","owner":"patternhelloworld","description":"Run MySQL Master Slave replication and cope with emergency with Docker and robust scripts","archived":false,"fork":false,"pushed_at":"2023-05-04T15:14:01.000Z","size":132,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-15T04:02:29.927Z","etag":null,"topics":["backup","docker","docker-compose","high-availability","mysql","mysql-replication","mysql8","replication","sql"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/patternhelloworld.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-23T14:43:55.000Z","updated_at":"2023-11-03T11:17:15.000Z","dependencies_parsed_at":"2023-05-27T09:30:51.171Z","dependency_job_id":null,"html_url":"https://github.com/patternhelloworld/docker-my-sql-replica","commit_stats":null,"previous_names":["patternknife/docker-my-sql-replica","patternhelloworld/docker-my-sql-replica"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/patternhelloworld/docker-my-sql-replica","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patternhelloworld%2Fdocker-my-sql-replica","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patternhelloworld%2Fdocker-my-sql-replica/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patternhelloworld%2Fdocker-my-sql-replica/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patternhelloworld%2Fdocker-my-sql-replica/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patternhelloworld","download_url":"https://codeload.github.com/patternhelloworld/docker-my-sql-replica/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patternhelloworld%2Fdocker-my-sql-replica/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264428912,"owners_count":23606721,"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":["backup","docker","docker-compose","high-availability","mysql","mysql-replication","mysql8","replication","sql"],"created_at":"2025-07-09T09:22:09.801Z","updated_at":"2025-07-09T09:22:21.741Z","avatar_url":"https://github.com/patternhelloworld.png","language":"Shell","readme":"# Docker-My-SQL-Replica\r\n\r\n\u003e Run Master-Slave MySQL DB and Cope with emergency with robust scripts.  \r\n\r\nTo Start DB or do recovery process must be [simple](https://github.com/Andrew-Kang-G/my-sql-replica).\r\n\r\n## How to Start\r\n\r\nRun this simply after coordinating some values on .env.example\r\n\r\n```\r\n$ cd 8.0\r\n$ cp -a .env.example .env\r\n\r\n# What to set '.env' ?\r\n## [Security] Set values for 'MYSQL_ROOT_PASSWORD', 'MYSQL_REPLICATION_USER_PASSWORD_MASTER'\r\n## [Safety] Consider setting the following 8 variables to be outside the project root.\r\n## MYSQL_..._PATH_...=./master/data\r\n\r\n$ bash run-replica.sh\r\n```\r\n\r\n## Emergency Recovery Mode (.env)\r\n\r\nWhen the Slave DB is corrupted, this mode removes all its data and points it back to the Master DB automatically.\r\n\r\n```\r\nSLAVE_EMERGENCY_RECOVERY=true\r\n## The mode is currently working in case of \"SEPARATED_MODE=false\"\r\nSEPARATED_MODE=false\r\n```\r\n\r\n## Separated Mode (.env)\r\n\r\nThe mode is for Master \u0026 Slave to be deployed on each instance. Make sure firewalls are open on your network layer. All the commands that you should run and .envs are the same for both Master and Slave.\r\n\r\n- .env\r\n```\r\n# Example\r\n\r\nSEPARATED_MODE=true\r\nSEPARATED_MODE_WHO_AM_I=master\r\nSEPARATED_MODE_MASTER_IP=172.27.0.20\r\nSEPARATED_MODE_MASTER_PORT=3506\r\nSEPARATED_MODE_SLAVE_IP=172.27.0.58\r\nSEPARATED_MODE_SLAVE_PORT=3507\r\n```\r\n\r\n- Master\r\n```\r\n$ cd 8.0\r\n$ cp -a .env.example .env\r\n$ bash run-replica.sh\r\n```\r\n\r\n- Slave\r\n```\r\n$ cd 8.0\r\n$ cp -a .env.example .env\r\n$ bash run-replica.sh\r\n```\r\n\r\n## Reference \r\nReplication in MySQL relies on the two servers beginning with an identical set of data, after which, every query that it is modifies data on the master makes the same changes to the data on the slave.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatternhelloworld%2Fdocker-my-sql-replica","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatternhelloworld%2Fdocker-my-sql-replica","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatternhelloworld%2Fdocker-my-sql-replica/lists"}