諸事情によりローカルに作ったmysqlにdockerコンテナから接続する必要があったので調べました。 2022/01/27追記 Docker desktop4.3.0において、記事で紹介しているdocker.for.win.localhostとdocker.for.mac.localhost両方ともは非推奨になりました。(なぜかwindowsのリリースノートもmac用のDNSが乗ってますが……) https://docs.docker.com/desktop/windows/release-notes/#docker-desktop-430 https://docs.docker.com/desktop/mac/release-notes/#docker-desktop-430 今後は変わりに以下のDNSにアクセスすれば良いとのことなので、記事は適宜読み替えるようおねがいします。macもw