• Local host setup (using all latest versions of everything):
    – Windows 10 (fully updated)
    – Apache
    – MariaDB
    – PHP

    Here are the steps I took that led to the error:
    1. On my computer’s localhost I created a db with the same name as the live site.
    2. Exported the db from the remote server, downloaded it, and imported it to my computer’s localhost.
    3. Downloaded all the live site files to the relevant folder on my computer’s localhost.
    4. Tried to open the site locally, but got the message “Error establishing a database connection”.

    5. Opened wp-config.php, changed the db username and password just in case it wanted my localhost credentials, but no go.

    Basically I cloned the site exactly, so I’m not sure why the db won’t connect?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Change the wp-config.php to have the credentials for the local database, not the ones for the live site. It sounds like you gave it WP credentials or something. Make sure it says ‘localhost’ for DB_HOST. Depending on your setup, having DB_USER as ‘root’ usually works, with DB_PASSWORD as ”.

    Thread Starter cbiweb

    (@cbiweb)

    Thank you Joy, that’s exactly what I had to do. It’s been a few years since I did this sort of move, so I missed that. Appreciate the help! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Yet another Error establishing a database connection topic’ is closed to new replies.