{"id":20841547,"url":"https://github.com/omgzui/mysql_m_s","last_synced_at":"2026-04-28T16:33:00.149Z","repository":{"id":110982151,"uuid":"168487890","full_name":"OMGZui/mysql_m_s","owner":"OMGZui","description":"mysql主从","archived":false,"fork":false,"pushed_at":"2019-01-31T08:16:16.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-27T02:52:56.953Z","etag":null,"topics":["docker","docker-compose","master-slave","mysql"],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","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/OMGZui.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":"2019-01-31T08:12:28.000Z","updated_at":"2020-09-14T06:36:43.000Z","dependencies_parsed_at":"2023-04-23T19:18:19.156Z","dependency_job_id":null,"html_url":"https://github.com/OMGZui/mysql_m_s","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OMGZui/mysql_m_s","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OMGZui%2Fmysql_m_s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OMGZui%2Fmysql_m_s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OMGZui%2Fmysql_m_s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OMGZui%2Fmysql_m_s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OMGZui","download_url":"https://codeload.github.com/OMGZui/mysql_m_s/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OMGZui%2Fmysql_m_s/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32389916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["docker","docker-compose","master-slave","mysql"],"created_at":"2024-11-18T01:20:38.079Z","updated_at":"2026-04-28T16:33:00.144Z","avatar_url":"https://github.com/OMGZui.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mysql主从\n\n```bash\n# 准备容器\ndocker pull mysql:5.5\n\n# 目录\n├── LICENSE\n├── README.md\n├── docker-compose.yml\n├── master\n│   ├── Dockerfile\n│   ├── docker-entrypoint-initdb.d\n│   │   └── init.sql\n│   └── my.cnf\n├── slave1\n│   ├── Dockerfile\n│   ├── docker-entrypoint-initdb.d\n│   │   └── init.sql\n│   └── my.cnf\n└── slave2\n    ├── Dockerfile\n    ├── docker-entrypoint-initdb.d\n    │   └── init.sql\n    └── my.cnf\n# 启动\ndocker-compose up -d master slave1 slave2\n\n# 主容器\n# GRANT REPLICATION SLAVE ON *.* to 'backup'@'%' identified by 'backup';\n# flush master;\ndocker-compose exec master /bin/bash\nmysql -u root -p \u003c docker-entrypoint-initdb.d/init.sql\n\n# 从容器\n# stop slave;\n# flush slave;\n# CHANGE MASTER TO MASTER_HOST='master', MASTER_PORT=3306, MASTER_USER='backup', MASTER_PASSWORD='backup';\n# START SLAVE;\n\n# 从容器1\ndocker-compose exec slave1 /bin/bash\nmysql -u root -p \u003c docker-entrypoint-initdb.d/init.sql\n\n# 从容器2\ndocker-compose exec slave2 /bin/bash\nmysql -u root -p \u003c docker-entrypoint-initdb.d/init.sql\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomgzui%2Fmysql_m_s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomgzui%2Fmysql_m_s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomgzui%2Fmysql_m_s/lists"}