How to change or reset WordPress website password, if you forgot it.
How to change the WordPress website, when the website is hosted in VPS hosting. You will find the instructions and commands in this blog post. You can copy commands.
First, log in to your VPS server using the following command.
ssh root@(Your VPS ip)
Then enter the password. Use the following command to log in to MySQL. In most of cases, you will not have to enter the password to login to the MySQL database.
mysql -u root -p
Enter your MySQL password. To see the list of databases and use the one of database use the following commands.
SHOW DATABASES;
USE (name-of-database);
Now look for a table name that ends with “users”.
SHOW TABLES;
This command gives you an idea of what’s going on inside.
SELECT ID, user_login, user_pass FROM (name-of-table-you-found);
Now decide new password. Convert it to md5 encryption online. link( http://www.miraclesalad.com/webtools/md5.php)Using the following command you can change the password. Replace the bracket using relevant information.
UPDATE (name-of-table-you-found) SET user_pass=”(MD5-string-you-made)” WHERE ID = (id#-of-account-you-are-resetting-password-for);
Confirm it changed using the following command.
SELECT ID, user_login, user_pass FROM (name-of-table-you-found)
Type Control-D to exit the mysql client. You can try a new password to log in to your website.