Support » Localhost Installs » Error establishing a database connection

  • Below is the message I received when trying to install WordPress locally. I am not sure what I’m doing wrong. I tried to re-upload the wp-config-sample file by changing the text in it to match the values in my phpadmin panel but I still get the same error message. I’ve deleted and reinstalled WP several times and I can’t seem to get it to work. I’ve been using MAMP to run the local site; can’t install WAMP on my machine.

    Any help would be appreciated.

    This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.
    Are you sure you have the correct username and password?
    Are you sure that you have typed the correct hostname?
    Are you sure that the database server is running?
    If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there,

    I’m assuming you’re trying to install locally on a Mac? If so, these are the points I would usually check in the wp-config-sample.php file during installation:

    – Replace ‘database_name_here’ with the name of your database e.g. ‘barbershop_db’
    – Replace ‘username_here’ with the default username ‘root’
    – Replace ‘password_here’ with the default password ‘root’
    – Leave ‘localhost’ as is.
    – Save the file.
    – Finally, rename wp-config-sample.php to wp-config.php

    I would then navigate to my browser and type in:

    “localhost:8888/YourWebsiteDirectoryName” e.g. “localhost:8888/barbershop”

    Hopefully that helps.


    Thread Starter briley87


    Thanks. I’m actually trying to install on a Windows computer.


    I’m new to setting up wordpress sites on a local server as well, but used the following tutorial

    to set up my first, and understand the relationship between the site and it’s database. I have since used Webmin to setup subsequent sites.



Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error establishing a database connection’ is closed to new replies.