How to reset admin password in WordPress/MySQL — CLI



This article will walk you through the steps of changing the admin/user's password in MySQL using the CLI.


Initially login to server and enter the command

mysql -u root -p

use (name-of-database)(ex:wordpress)

show tables;

SELECT ID, user_login, user_pass FROM (name-of-table-you-found);

Now go to type in the password and generate the MD5 Hash.

UPDATE wp-users SET user_pass=<MD5 Hash> WHERE ID = 1;

SELECT ID, user_login, user_pass FROM (name-of-table-you-found);

Now you updated the password.



Manoj Deshmukh

3+ Years’ Experience in Cybersecurity, VAPT, Cyber Forensics. Certified CompTIA Cybersecurity Analyst • Certified EC-Council CEH Practical’s