This brief tutorial shows students and new users how to easily change WordPress admin user email address and password from its database server. Whether you’re using MySQL or MariaDB server, this tutorial should help you.
Changing WordPress admin user password and email address can be done from WordPress admin dashboard easily. However, when you’re locked out of the admin areas, the method below should help you recover your account.
I’m writing this because it happened to me.
The email address associated with my WordPress account was no longer active. It was dead and had no access to it.
I forgot my password an needed to reset. WordPress allows you to recover your lost password, but you will need the email address associated with your account. If you have no access to that email account, you may not be able to successfully restore or may be difficult to recover your account.
So, if you find yourself in a situation where you’ve lost access to your WordPress admin dashboard and can’t recover because the email account associated with it is no longer valid, the below steps can get you restored.
Resetting WordPress User Passwords
One method to reset WordPress admin user password is to do it from its database. This requires that you have root access to the system as well as the WordPress databases. Without root or administrative access, you may not be able to reset the account password or email address.
To change WordPress admin user password from MySQL or MariaDB, run the commands below to logon to the server.
sudo mysql -u root -p
After logging in, run the commands below to change WordPress admin user password
UPDATE `wp_users` SET `user_pass` = MD5('new_password_here') WHERE `wp_users`.`user_login` = "username";
Replace username with the admin user account name used to logon to WordPress.
This is how to reset WordPress admin user password.
Resetting WordPress User User Email Addresses
Now that you’ve learned how to reset the admin user password, the below commands show you how to change the user email address. The email address is the one associated with the account.
To change it, run the commands below.
UPDATE `wp_users` SET `user_email` = "new_email_address_here" WHERE `wp_users`.`user_login` = "username";
Replace username with the account named used to logon to WordPress.
Congratulations! You’ve just learned how to change WordPress user password and email address from its database.
This post shows students and new users how to easily change or reset WordPress user email address and password from its database. This should work whether the database server is MySQL or MariaDB.
When you’ve lost access to your WordPress account, the method above should help you recover.
You may also like the post below: