Tagged: MySQL

Reset WordPress password from the database

It’s easily done, we forget the password for a WordPress account, or get asked by a client to reset it. What happens if you don’t have access to the email account for that user?

You may just want to reset it without having to use the ‘forgotten password’ link where you then have to log into email accounts and then change it from a randomly generated one. If you have access to the database, there’s a simple way to do this. Read on to learn how to reset WordPress password from the database.

Reset WordPress password using a MySQL command

In this example, I am going to assume that you are resetting the main Admin password (usually ID 1). Double check this first, and always use a secure password. Assuming the user ID is 1 and the new password is ‘nUp@ssw0rd’, run:

UPDATE wp_users u SET u.`user_pass` = md5('nUp@ssw0rd') WHERE u.`ID` = 1

WordPress uses a function called md5 which creates the hash for a given input so passwords aren’t stored in plaintext. Any comments or questions, sound them below.

Further reading

Tutorial – Install Apache, PHP and MySQL on Raspberry Pi

Tutorial – Install Apache, PHP and MySQL on Raspberry Pi

The fundamental services required to turn your Raspberry Pi into a web server consist of Apache (the web server itself), PHP (scripting language) and MySQL (database server). When installed on a Linux based system, the collective term for these is LAMP.

There are other secondary services which aren’t quite as important at this stage to provide FTP and outbound mail, but that’ll be covered in a separate tutorial.

(more…)