{"id":26192977,"url":"https://github.com/garymengcom/mysql-replication-docker","last_synced_at":"2025-03-12T01:32:14.393Z","repository":{"id":262363276,"uuid":"886738038","full_name":"garymengcom/mysql-replication-docker","owner":"garymengcom","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-29T17:05:58.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-27T13:06:15.095Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/garymengcom.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":"2024-11-11T14:12:10.000Z","updated_at":"2024-12-29T17:06:02.000Z","dependencies_parsed_at":"2025-01-27T13:06:16.560Z","dependency_job_id":"aec97449-6e62-40f1-958b-db6aee4b3aa1","html_url":"https://github.com/garymengcom/mysql-replication-docker","commit_stats":null,"previous_names":["yeszao/mysql-replication-docker","garymengcom/mysql-replication-docker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garymengcom%2Fmysql-replication-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garymengcom%2Fmysql-replication-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garymengcom%2Fmysql-replication-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garymengcom%2Fmysql-replication-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garymengcom","download_url":"https://codeload.github.com/garymengcom/mysql-replication-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243139930,"owners_count":20242643,"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-03-12T01:32:12.060Z","updated_at":"2025-03-12T01:32:14.170Z","avatar_url":"https://github.com/garymengcom.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# MySQL Replication Docker\n\nThis repository provides a **Docker-based** setup for creating a **MySQL replication** environment with a source (master) and replica (slave) configuration. \n\nIt simplifies setting up a **MySQL database** with replication, making it easy to test and deploy in a local or cloud-based environment.\n\n\n# Features\n- **✅ Docker-based**: The setup uses `docker-compose.yml` to create a MySQL master-slave replication environment.\n- **✅ Environment Variables**: The configuration is done using environment variables, making it easy to customize the setup.\n- **✅ Replication**: The master MySQL server is configured to replicate data to the replica MySQL server.\n- **✅ Security**: The setup uses a separate user for replication, ensuring that the replication process is secure.\n- **✅ Easy Deployment**: The setup can be easily deployed on a local machine or a cloud-based environment.\n\n\n# Deployment\n1. Clone the repository to your master machine and replica machine.\n    ```bash\n    git clone https://github.com/yeszao/mysql-replication-docker.git\n    ```\n2. Create `.env` file in the root directory of the repository on both machines.\n    ```bash\n    cd mysql-replication-docker\n    cp docker-compose.yml.example docker-compose.yml\n    ```\n   Add the values of the environment variables base on your needs.\n2. Start the MySQL `master` container on the master machine.\n    ```bash\n    docker compose up -d master\n    ```\n3. Start the MySQL `slave` container on the replica machine.\n    ```bash\n    cd mysql-replication-docker\n    docker compose up -d slave\n    ```\n   \n\n# Environment Variables\nThe following environment variables are available for configuration in the `.env` file:\n\n**Master MySQL Server**\n- `MASTER_ROOT_PASSWORD`: The password for the root user on the master MySQL server.\n- `MASTER_EXPOSE_PORT`: The port on which the master MySQL server is exposed to host.\n- `REPLICATOR_USERNAME`: The username for the replicator user on the replica MySQL server.\n- `REPLICATOR_PASSWORD`: The password for the replicator user on the replica MySQL server.\n\n**Replica MySQL Server**\n- `SLAVE_ROOT_PASSWORD`: The password for the root user on the replica MySQL server.\n- `SLAVE_EXPOSE_PORT`: The port on which the replica MySQL server is exposed to host.\n- `MYSQL_MASTER_HOST`: The hostname or IP address of the master MySQL server.\n- `MYSQL_MASTER_PORT`: The port on which the master MySQL server is listening.\n- `REPLICATOR_USERNAME`: The username for the replicator user on the replica MySQL server.\n- `REPLICATOR_PASSWORD`: The password for the replicator user on the replica MySQL server.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarymengcom%2Fmysql-replication-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarymengcom%2Fmysql-replication-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarymengcom%2Fmysql-replication-docker/lists"}