Here are step by step to reset wordpress password if forgot the password.
Make sure you have access to the databases.
mysql> use wordpress;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+-----------------------+
| Tables_in_wordpress |
+-----------------------+
| wp_commentmeta |
| wp_comments |
| wp_links |
| wp_options |
| wp_postmeta |
| wp_posts |
| wp_term_relationships |
| wp_term_taxonomy |
| wp_termmeta |
| wp_terms |
| wp_usermeta |
| wp_users |
+-----------------------+
12 rows in set (0.00 sec)
mysql>
Generate a New Password Hash: WordPress uses a salted MD5 hash for passwords. You can generate a new password hash.
Here is example python script
import bcrypt
def generate_wordpress_hash(password):
# Generate a random salt and hash the password
hashed_password = bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt())
return hashed_password.decode('utf-8')
# Replace 'your_password_here' with the desired password
new_password = 'your_password_here'
wordpress_hash = generate_wordpress_hash(new_password)
print("WordPress-compatible Hash:", wordpress_hash)
Back to Mysql Command
UPDATE wp_users SET user_pass = 'your-hash-password' WHERE user_login = 'admin';
Adjust your user_pass and user_login
Hope it works for you as well if needed, thank you.
Comments
Post a Comment