databasewordpressmamp

Error Establishing Database Connection with Wordpress in MAMP


I have a few local Wordpress sites already running in my folder for MAMP, but when I try to create a new one to go through the install process it is throwing "Error Establishing Database Connection".

I know there is not a wp-config.php file setup, but I thought this first step was going to create one?

I have tried both Wordpress 5 and 4 to see if the version isolates the problem.


Solution

  • I had the same problem but solved it by going into the wp-config-sample.php file and renaming it wp-config.php. Then I changed the file contents to the database name I set up in MAMP and the username and password to root. I was then able to open the project.

    For reference, I used this video: https://www.youtube.com/watch?v=iIxbv4n5jgQ