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

phpmyadmin - ERROR ESTABLISHING DATABASE CONNECTION

[im a noob - please go easy] So i started the 'installing WordPress locally' track and got as far as installing MAMP, setting up the database and making a user with full privilages for logging into localhost/database/admin. Works like a charm all day, get to tinker with WP and plugins. Log in the next day to continue course and it doesn't recognise the username and password i have copy and pasted into notepad. Nope, there are no accidental spaces or anything added. So i tried resetting the password as i had my email set up in the user info. Error sending the mail. Ok - so i go into phpmyadmin and change the user password. in its infinite wisdom i'm now met with the database error in the subject title. I dont even get an opportunity to log in and im just really confused why this has happened.

[UPDATE] So I read that if you change the DB password it wont actually automatically update, you have to change it in the config file. I've done this and the database connection is now back, however the original issue (cannot log into WP admin portal using correct credentials) still persists. I've gone into the database users and tried both editing the login username and password of the current admin user (this didnt work) and making a new user (this also didnt work). Why wont it accept the login information?!?!?!

dublinruncommutr
dublinruncommutr
5,944 Points

If you changed the database password of the user you are using for the database connection from Wordpress, you will need to change the password in the wp-config.php file

/** MySQL database username */
define('DB_USER', 'admin');

/** MySQL database password */
define('DB_PASSWORD', 'password');

you can find wp-config.php in your root web directory for your wordpress site.

If you are trying to change the password for a Wordpress site user via PHPMyAdmin it will be a little trickier because the passwords are encrypted with an MD5 hash when stored into the database, so you can't just update it to the password. You would need to call the MD5 function in PHPMyAdmin when updating the user's password in the wp_users table. http://www.wpbeginner.com/beginners-guide/how-to-reset-a-wordpress-password-from-phpmyadmin/