Error establishing a database connection - WP-config

What issue or error are you experiencing?

I am trying to access the website I have been working on but I get the error: ’ Error establishing a database connection". I have created many website using Local and haven’t ever experience this issue before. I read other forums and most suggest checking the wp-config files although I don’t know where I can access these on Local. Please advise.


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


System Details

  • Local Version:
    7.4.1

  • Operating System (OS) and OS version:


Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi @WhitneyN

We would be happy to assist with your Local troubleshooting! Could you provide some more details to help us take a further look?

  • What is your OS?

  • What version of Local are you on?

  • Please attach a copy of your Local Logs

Keep us posted and we’d be happy to help further!

Thank you, Nick!

OS: macOS Montery Version 12.5.1

Local Version: 7.4.1

Local Logs:
local-lightning.log (861.2 KB)
local-details.json (715 Bytes)
error.log (6.8 MB)

Local is only on version 7.2 right now. Is 7.4.1 your PHP version?

Are you running other developer applications simultaneously? Apps like MAMP, XAMPP, or Docker for example.

It looks like Local might be getting blocked by another application. You could try changing your router mode to see if that works. Preferences>Advanced>Router Mode>Localhost

Ah, yes apologies 7.4.1 is my PHP version.

No other developer applications are being used.

That seemed to fix the issue- yay, thank you!

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.

Glad to hear it @WhitneyN! Happy Developing :slight_smile: