Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Error Establishing a Database Connection
I followed the instructions for using MAMP and installing WordPress, and I was able to work on a website in wordpress for a few hours yesterday. Today, I opened MAMP, clicked "open webstart page" then clicked "My Website." I got the error message "Error Establishing a Database Connection. I went back to MAMP page and clicked "Tools" and then "phpMyAdmin", I got an error that read, in part:
"phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server."
I opened wp-config.php, and the username is the same as I put in yesterday (per the video's instructions): wpuser. The password is the same password that I had generated randomly yesterday when I set it up.
I don't know what to do. Its so frustrating. I need to be working on my website.
Perhaps another spot to check for errors is where the document root in the MAMP settings is pointing to. You can find that by opening up MAMP > Preferences > Web Server and ensuring the file path under "document root" is pointing to the root folder of your project. Hopefully that helps!