Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Setting Up WordPress Locally

I egt this error when installing wordpress. I created the database

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?

7 Answers

...Can you confirm you have given them the correct username, password and hostname? Otherwise we can't be sure where the error is coming from.

yes root to both and localhost

Then it's most likely that WordPress can't connect to the database, like it's saying. Have you checked that the database is online and set-up? If it's a new domain it can sometimes take awhile for the database to be available for use.

Im setting it up locally so the domain is localhost then navigating to allisongrayce.com im following the adventure on here but somehow its not working. ive checked the setting up Xammp again and everythign is correct

That's fine, but you need to check if the database is actually online. This information will most likely be provided through your domain host (whoever you bought it from.)

i want to use this fully offline and access it through local host

Matt Campbell
Matt Campbell
9,767 Points

There'll be a miss spelling somewhere. Be it the database name or username etc. just double check everything.

still nothing

http://grab.by/nVPu

thats a screenie of everything

Matt Campbell
Matt Campbell
9,767 Points

You don't have a wp_config.php file in the install root folder. Also, are you using wp_portfolio as the database? I'd get rid of the wp_ bit.

this is following the instructions off this video http://teamtreehouse.com/library/websites/how-to-build-a-wordpress-theme/content-strategy-with-wordpress/installing-and-setting-up-wordpress-locally

it says nothign about all that :/ just set up as is. nothign about the config file

also renamed it to wp-config and still no luck

Kevin Korte
Kevin Korte
28,149 Points

What localhost software are you using? Did you turn MySQL on when Apache fired up?

yes both apache and mysql are up and in that order. Im using xampp

Kevin Korte
Kevin Korte
28,149 Points

Okay, that's what I use. So, walking through the steps.

Open up localhost/phpmyadmin

Create a database, create a user account that has access to that database.

Place wordpress in the htdocs or subfolder you want. Open wp-config-sample, enter your database name, database password, username, and user password, and save that file just as wp-config.php

Than try navigate to the wordpress installation in your browser, and it should walk you through the rest.

nope still nothing. The tutorial in the video i linked, which is the treehouse one does nothing like that

Kevin Korte
Kevin Korte
28,149 Points

Essentially he did, he just had WP create the config file instead of manually creating it like I did. That included giving WP credentials to log into that database.

Maybe try deleting the database and starting the install from fresh? Short of triple checking every value to make sure the database values match WP's, I'm not sure.

I screen shotted my settings and they were all correct :/ ive tried both ways and still no luck. only thing i can suggest is just working with the ftp on this challenge instead :/

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

If you use the setup wizard in the browser (around 2min) it will create the wp-config.php file for you.

If you're not going to take this approach you would have to create the file yourself.