How to reset admin password wordpress from SQL.

Q: How to reset WordPress password via SQL ?

A: Login to mysql database

mysql -u wordpress -p

use db_wordprs;

MariaDB [(none)]> use db_wordprs;
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

MariaDB [db_wordprs]> select * from wp_users;

+—-+————+————————————+—————+——————+———-+———————+———————+————-+————–+
| ID | user_login | user_pass | user_nicename | user_email | user_url | user_registered | user_activation_key | user_status | display_name |
+—-+————+————————————+—————+——————+———-+———————+———————+————-+————–+
| 1 | admin | $P$BeI/6SDDb5x33lthRtdqaoVuO8.TfH/ | admin | liviu@team-work.ro | | 2016-10-26 07:55:16 | | 0 | admin |
+—-+————+————————————+—————+——————+———-+———————+———————+————-+————–+
1 row in set (0.00 sec)

And now change / update password:
UPDATE wp_users SET user_pass= MD5(‘Your-Password’) WHERE ID = 1;

MariaDB [db_rezes]> UPDATE wp_users SET user_pass= MD5(‘Your-Password’) WHERE ID = 1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

Enjoy, done.

Leave a Reply

Your email address will not be published. Required fields are marked *

2 + 1 =


This site uses Akismet to reduce spam. Learn how your comment data is processed.