{"id":18088998,"url":"https://github.com/eriksjolund/podman-mysql","last_synced_at":"2026-04-30T15:32:14.433Z","repository":{"id":160814627,"uuid":"635625464","full_name":"eriksjolund/podman-mysql","owner":"eriksjolund","description":"run mysql with Podman on macOS","archived":false,"fork":false,"pushed_at":"2023-05-03T06:12:48.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T02:32:17.748Z","etag":null,"topics":["demo","documentation","macos","mysql","mysql-server","podman"],"latest_commit_sha":null,"homepage":"","language":null,"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/eriksjolund.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}},"created_at":"2023-05-03T05:22:25.000Z","updated_at":"2024-03-25T00:55:22.000Z","dependencies_parsed_at":"2023-06-25T22:27:53.513Z","dependency_job_id":null,"html_url":"https://github.com/eriksjolund/podman-mysql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eriksjolund/podman-mysql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriksjolund%2Fpodman-mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriksjolund%2Fpodman-mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriksjolund%2Fpodman-mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriksjolund%2Fpodman-mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eriksjolund","download_url":"https://codeload.github.com/eriksjolund/podman-mysql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriksjolund%2Fpodman-mysql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32469344,"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":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"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":["demo","documentation","macos","mysql","mysql-server","podman"],"created_at":"2024-10-31T17:42:33.719Z","updated_at":"2026-04-30T15:32:14.405Z","avatar_url":"https://github.com/eriksjolund.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"status: draft documentation, right now untested\n\n# podman-mysql\n\nRun mysql on macOS with Podman.\n\nDocumentation of how to run __docker.io/library/mysql__ with Podman on macOS and store the mysql data directory on the macOS host.\n\n### Examine the container image on a Linux computer\n\nOn a Fedora 38 (Linux) computer find out which UID and GID\nin the container that should be mapped to your regular user.\n\n1. `sudo dnf install podman`\n2. `podman pull docker.io/library/mysql`\n3. run the command\n   ```\n   $ podman image inspect \\\n\t     --format \"user: {{.User}}\" \\\n\t     docker.io/library/mysql\n   user:\n   $\n   ```\n   The User field in the image is not set. This is often a hint\n   that the container image should be started as the container user __root__ (which is the default).\n4. `mkdir datadir`\n5. run the mysql container\n   ```\n   podman run \\\n       --rm \\\n       -d \\\n       --name mysql \\\n       -e MYSQL_ROOT_PASSWORD=foobar \\\n       -v ./datadir:/var/lib/mysql:Z \\\n       docker.io/library/mysql\n   ab27226071714d0e15fe4f08014fd42b2a2fd78813dfde609d933cec62292cac\n   ```\n6. Check which UID and GID ownership the files under the directory _datadir_ have.\n   Run the command\n   ```\n   $ podman unshare ls -ln datadir\n   total 90556\n   -rw-r-----. 1 999 999       56 May  3 07:43  auto.cnf\n   -rw-r-----. 1 999 999        0 May  3 07:44  binlog.index\n   -rw-------. 1 999 999     1680 May  3 07:44  ca-key.pem\n   -rw-r--r--. 1 999 999     1112 May  3 07:44  ca.pem\n   -rw-r--r--. 1 999 999     1112 May  3 07:44  client-cert.pem\n   -rw-------. 1 999 999     1680 May  3 07:44  client-key.pem\n   -rw-r-----. 1 999 999   196608 May  3 07:44 '#ib_16384_0.dblwr'\n   -rw-r-----. 1 999 999  8585216 May  3 07:43 '#ib_16384_1.dblwr'\n   -rw-r-----. 1 999 999     5554 May  3 07:44  ib_buffer_pool\n   -rw-r-----. 1 999 999 12582912 May  3 07:44  ibdata1\n   -rw-r-----. 1 999 999 12582912 May  3 07:44  ibtmp1\n   drwxr-x---. 2 999 999      173 May  3 07:44 '#innodb_redo'\n   drwxr-x---. 2 999 999      187 May  3 07:44 '#innodb_temp'\n   drwxr-x---. 2 999 999      143 May  3 07:44  mysql\n   -rw-r-----. 1 999 999 25165824 May  3 07:44  mysql.ibd\n   drwxr-x---. 2 999 999     8192 May  3 07:44  performance_schema\n   -rw-------. 1 999 999     1676 May  3 07:44  private_key.pem\n   -rw-r--r--. 1 999 999      452 May  3 07:44  public_key.pem\n   -rw-r--r--. 1 999 999     1112 May  3 07:44  server-cert.pem\n   -rw-------. 1 999 999     1680 May  3 07:44  server-key.pem\n   drwxr-x---. 2 999 999       28 May  3 07:44  sys\n   -rw-r-----. 1 999 999 16777216 May  3 07:44  undo_001\n   -rw-r-----. 1 999 999 16777216 May  3 07:44  undo_002\n   ```\n   All the files are owned by the container UID 999 and GID 999.\n   This is good to know when running under macOS\n   because there we need to map UIDs and GIDs so that these files\n   will be stored with the same ownership as the regular user on the host.\n   To do that we will use the command-line option `--userns keep-id:uid=999,gid=999` \n\n### Run mysql on macOS with Podman\n\nInstall Podman\n\n1. `brew install podman`\n2. `podman machine init`\n3. `podman machine start`\n\nRun mysql\n\n1. `mkdir datadir`\n2.  run the mysql container\n   ```\n   $ podman -c podman-machine-default \\\n       run \\\n       --rm \\\n       --userns keep-id:uid=999,gid=999 \\\n       -d \\\n       -e MYSQL_ROOT_PASSWORD=foobar \\\n       --security-opt label=disable \\\n       --name mysql \\\n       -v ./datadir:/var/lib/mysql \\\n       docker.io/library/mysql \n   ed8b69089a3d813a44d40f85df9044d0efca6f0720bc1c0dc371edbcba386ccf\n   ```\n3. optional: verify that the files in the directory _datadir_ are owned by your user and group\n```\n$ find datadir | wc -l\n186\n$ find datadir -not -user $(id -un)\n$ find datadir -not -group $(id -gn)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feriksjolund%2Fpodman-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feriksjolund%2Fpodman-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feriksjolund%2Fpodman-mysql/lists"}