Skip to content

Connect to local MySQL from Mac

Use 127.0.0.1 as the host when MySQL runs on your Mac.

Have the MySQL service running and a database account ready. For a container, use the Docker guide instead.

Check the server configuration for its TCP port; the usual MySQL port is 3306. You also need the database name, user name, and password.

TableAI connects over TCP. A successful Terminal login through a Unix socket does not confirm TCP access; see socket and TCP errors.

  1. Choose File › New Connection….
  2. Set Driver to MySQL.
  3. Enter a Name, such as Bookstore Local.
  4. Fill in the connection details below.
  5. Set SSL Mode for your server.
  6. Click Test.
  7. Click Save & Connect after the test succeeds.
Field Example
Host 127.0.0.1
Port 3306
Database docs_bookstore
User demo_user
Password Your database password

Replace the example database and account with your own. Connection basics covers password storage and other shared options.

MySQL connection form filled with a local host, port, database, and demo user

Use Disable for a trusted loopback server that does not use TLS. For certificate verification, follow SSL/TLS settings and use the hostname on the certificate.

A server on another computer needs a reachable network address. For a LAN host, check macOS Local Network permission.

connection refused
Access denied for user

For a refused connection, check that the service is running and its bind-address accepts the selected TCP address. Error 2002 gives a TCP test; error 1045 covers account checks.

Continue with write and run SQL, or return to the MySQL overview. Use connection troubleshooting for other failures.