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

Installing and Setting Up WordPress Locally

Im setting up Wordpress on localhost using Xampp on a PC I got to the part where you are setting up wordpress after putting my database info in all correct I get the following error

"Error establishing a database connection

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?

" Only thing i think it can be is the third option how do I check that the database server is running?

3 Answers

Try this first: in your taskbar there should be a xampp icon, open this by right clicking or double clicking, and click the Start button on MySQL service listed in the window that opens up.

If that doesn't work try this:

First uninstall everything, then install xampp again. Follow all directions perfectly.

Then install bitnami for xampp and you will have Wordpress installed SUPER easily.

You can mess with configuring databases later on after you get the basics of Wordpress down. It's important to have successes early on or you will feel discouraged. This should make it easier. Good luck!

Thanks Chad, its getting late here now so i'm going to try this tomorrow. Yeah this has been bugging me all weekend trying to get this to work if i get to a stage where i get stuck i take a break or move on to something else then try go back to it without feeling frustrated and missing something obvious. I have always had issues with MySQL databases for as long as i can remember.

Matt Campbell
Matt Campbell
9,767 Points

You've started the MySQL server and actually set up a database through PHP MyAdmin?

Yes, I have done that i followed the video tutorial, except in the video he is using MAMP for Mac so its a little different.

Jeesun Kim
Jeesun Kim
4,866 Points

I had a similar problem but I solved it by clicking "Add" under "Add User To Database" on MySQL Databases -> click "all privileges" on database.