{"id":23468898,"url":"https://github.com/jamielsharief/docker-mysql","last_synced_at":"2025-04-14T15:11:35.972Z","repository":{"id":113276388,"uuid":"327935312","full_name":"jamielsharief/docker-mysql","owner":"jamielsharief","description":"A MySQL 8.0 docker image for developers that works on both x86, ARM (M1) chips.","archived":false,"fork":false,"pushed_at":"2021-12-14T10:46:42.000Z","size":22,"stargazers_count":17,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T04:05:20.447Z","etag":null,"topics":["amd64","arm64","docker","m1","mysql","mysqld"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/jamielsharief/mysql","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamielsharief.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2021-01-08T15:08:28.000Z","updated_at":"2024-05-30T02:58:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"80acaf8d-6432-4832-857a-182e58acb471","html_url":"https://github.com/jamielsharief/docker-mysql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamielsharief%2Fdocker-mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamielsharief%2Fdocker-mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamielsharief%2Fdocker-mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamielsharief%2Fdocker-mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamielsharief","download_url":"https://codeload.github.com/jamielsharief/docker-mysql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248904639,"owners_count":21180835,"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":["amd64","arm64","docker","m1","mysql","mysqld"],"created_at":"2024-12-24T14:36:50.109Z","updated_at":"2025-04-14T15:11:35.960Z","avatar_url":"https://github.com/jamielsharief.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker MySQL 8.x Image (AMD64/ARM64)\n\nThe official MySQL repo image only supports AMD64 processors, and as Apple has introduced M1 chips (ARM64), I decided to build my own image so that dockerized apps that use MySQL can work without configuration changes on both the AMD64 and ARM64 processors.\n\nThis image inherits nearly all settings from the official docker [MySQL](https://hub.docker.com/_/mysql) image, \nbut the `mysql_native_password authentication` plugin is enabled by default.\n\nThe root user is also granted permission to log in from any host e.g `@%` by default , so you can connect with [tableplus](https://tableplus.com) or similar database managers. You can change the host by setting the env var `MYSQL_ROOT_HOST`.\n\nThe default username is `root` and password is `root`, however you can change by setting the new password in the env var `MYSQL_ROOT_PASSWORD`.\n\nIf you want it to create a database then set `MYSQL_DATABASE` with the database name. The image will also create a new user for you if you supply both a `MYSQL_USER` and `MYSQL_PASSWORD`.  If you are creating both a user and database, then full permissions will be granted to the new user from any host.\n\n### Docker Compose Service\n\nTo add as a service to your `docker-compose.yml`\n\n```yaml\nservices:\n  db:\n    image: jamielsharief/mysql:latest\n    volumes:\n      - mysql-data:/var/lib/mysql\n    environment:\n      - MYSQL_ROOT_PASSWORD=root\n    ports:\n      - \"3307:3306\"\n```\n\n### Container\n\nTo work with a normal container, remember you need to setup volumes so data is persisted.\n\n\nTo start a MySQL container with the username `root` and password `root`\n\n```\n$ docker run -it -d -p 3306:3306 jamielsharief/mysql:latest \n```\n\n\nTo change the root password\n\n```\n$ docker run -it -p 3306:3306 -e MYSQL_ROOT_PASSWORD=foo jamielsharief/mysql:latest \n```\n\nTo create a database\n\n```\n$ docker run -it -p 3306:3306 -e MYSQL_DATABASE=application jamielsharief/mysql:latest \n```\n\nTo create a user you must supply both a username and password\n\n```\n$ docker run -it -p 3306:3306 -e MYSQL_USER=jon -e MYSQL_PASSWORD=secret jamielsharief/mysql:latest \n```\n\nIf you are creating a user and a database, full permissions will be granted for that\nuser on that database.\n\n\nHere is a full example\n\n```\n$ docker run -it -p 3306:3306 -e MYSQL_ROOT_PASSWORD=foo -e MYSQL_USER=roger -e MYSQL_PASSWORD=beck -e MYSQL_DATABASE=application jamielsharief/mysql:latest \n```\n\n## Resources\n\n- [Github](https://github.com/jamielsharief/docker-mysql)\n- [Docker Hub](https://hub.docker.com/r/jamielsharief/mysql)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamielsharief%2Fdocker-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamielsharief%2Fdocker-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamielsharief%2Fdocker-mysql/lists"}