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

PHP

Database Error for all local sites

HELP! No idea what I have done but all of a sudden every site I have on my laptop which I try to load via localhost is throwing up "A Database Error Occurred. Unable to connect to your database server using the provided settings." even though the very same websites connecting to the very same databases were working fine a few days ago. Ive tried installing a new wordpress site from scratch and I have the same problem, and Im even getting the same error message when just loading http://localhost/. If anyone can tell me what might of happened and how I can fix it that would be great. Im guessing I must have changed something behind the scenes but I have no idea what or how I did it.

4 Answers

Can you tell us a bit more about what platform you're on and what database you're using? It sounds like maybe your database server isn't running.

I'm using windows 8.1 and MySQL. According to xampp control panel both Apache and MySQL seem to be running, as far as I can tell

Interesting. What settings are you using for your WordPress site locally?

Hi Alan, I don't think it was an issue with Wordpress. Something had obviously happened to my Xampp installation (although I have no idea what). I uninstalled Xampp and reinstalled it and that seems to have fixed the issue thankfully. Thank you for your help though.