Connect to MySQL in Docker from Mac
Connect to the port Docker publishes on your Mac, rather than the container’s internal address.
Before you start
Section titled “Before you start”You need a running MySQL container with a published TCP port and an existing database account. This guide assumes Docker runs on your Mac.
Find your connection details
Section titled “Find your connection details”List the running containers:
docker psRead the MySQL container’s port mapping. For 127.0.0.1:3307->3306/tcp, TableAI connects to 127.0.0.1:3307. Port 3306 belongs to MySQL inside the container.
Read the database and account names from your container setup. The account in an existing database volume can retain its original password after environment variables change.
Keep the database volume when correcting credentials. Removing it can delete your database.
Connect to MySQL in Docker from Mac
Section titled “Connect to MySQL in Docker from Mac”- Open the connection form and select MySQL as Driver.
- Set Host to
127.0.0.1. - Set Port to the published host port, such as
3307. - Enter the container’s Database, User, and Password.
- Configure TLS as described below.
- Click Test, then Save & Connect when it succeeds.
TLS and remote containers
Section titled “TLS and remote containers”For a trusted loopback container without TLS, select SSL Mode › Disable. For a TLS-enabled server, follow SSL/TLS settings.
For Docker on another machine, use that machine’s reachable address and published port. An SSH tunnel can provide access to a private Docker host.
If it does not connect
Section titled “If it does not connect”connection refusedAccess denied for userIf the container is absent from docker ps, check why it stopped. If it is running, compare the published port with Port in TableAI. A container without a host port mapping is not reachable through 127.0.0.1 on your Mac.
Use error 2002 to test TCP access and error 1045 for credentials. A localhost port does not require macOS Local Network permission; other network checks are in connection troubleshooting.
Continue with browse and search, or return to the MySQL overview.