I’ve seen this question a lot where people have forgotten their WordPress admin password and they don’t remember their email in order to use the “Lost Password” feature.
The password can be changed/reset from MySQL/MariaDB using the command line.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
First you need to identify the table responsible for storing WordPress user accounts. Usually the table that stores all user information is wp_users but you may have different database prefix so you can check your wp-config.php file and search for the following line:
Also you need to know the name of the database as well. You can get this information from wp-config.php as well. You need to check these lines:
Now when you know the table prefix and the database.
1. You need to access MySQL
2. You can query the wp_users table to retrieve all the needed information:
3. Now you need to generate a MD5 generated password in order to change/reset the password. There is two ways to generate update the password.
The first one is to create a MD5 hashed password via the command line:
Replace the “password” string used in this example with your own strong password.
Now you need to update the password using the following query:
Now you should be able to access the WordPress admin area using the new password
The other method is to update the password without using any MD5 password generator:
You need the change the password string with the actual password you want to use.
Once the query is executed you should be able to login using the new password.
I hope this helps.
Regards, Alex
Hi, @saud968
Are you logged as the root user in the MySQL console? Make sure that you do not have any typos as well.
show databases;
and
SHOW DATABASES
should work just fine for you.
Hope that this helps! Regards, Alex
thanks. really helpful info