Sage/Bedrock with MAMP: can't connect to MySQL

Hi there

Just setting up Sage/Bedrock without Trellis and Vagrant and am running the installation on my local machine via MAMP.

All is good except when I set my DB_HOST in the .env file, I can’t connect.

I have other non-Bedrock sites running in MAMP all of which work fine with “localhost” as the db host setting.

I’ve tried this as well as localhost:8889 as this is the port that MAMP uses for MySQL.

Any clues on how to get my wordpress installation to connect to the database?

It should be the same as what you put in wp-config.php

Yeah, that’s what I would have thought. Will keep investigating.

Do you mean you get the “Cannot connect to the database” error?

I ask because many new to Bedrock don’t know to set up the Apache/nginx document root to the web folder

Ah, it was simply a port issue in MAMP at my end — I simply needed to set MySQL to connect over a different port from the default 8889.