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 trialAdam Davies
65 PointsSetting 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
Laura Hutton
5,188 Points...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.
Adam Davies
65 PointsMatt Campbell
9,767 PointsYou 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.
Adam Davies
65 Pointsthis 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
28,149 PointsWhat localhost software are you using? Did you turn MySQL on when Apache fired up?
Adam Davies
65 Pointsyes both apache and mysql are up and in that order. Im using xampp
Kevin Korte
28,149 PointsOkay, 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.
Adam Davies
65 Pointsnope still nothing. The tutorial in the video i linked, which is the treehouse one does nothing like that
Kevin Korte
28,149 PointsEssentially 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.
Adam Davies
65 PointsI 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 :/
James Barnett
39,199 Pointsadam davies - Try starting out and following this tutorial on using Xampp for local Wordpress Theme Development.
Zac Gordon
Treehouse Guest TeacherIf 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.
Adam Davies
65 PointsAdam Davies
65 Pointsyes root to both and localhost
Laura Hutton
5,188 PointsLaura Hutton
5,188 PointsThen 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.
Adam Davies
65 PointsAdam Davies
65 PointsIm 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
Laura Hutton
5,188 PointsLaura Hutton
5,188 PointsThat'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.)
Adam Davies
65 PointsAdam Davies
65 Pointsi want to use this fully offline and access it through local host
Matt Campbell
9,767 PointsMatt Campbell
9,767 PointsThere'll be a miss spelling somewhere. Be it the database name or username etc. just double check everything.