How to reset admin password in WordPress/MySQL — CLI

Manoj Deshmukh
Jun 21, 2023

--

Overview

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

Process

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 https://www.md5hashgenerator.com/ 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

4+ Years’ Experience in Cybersecurity, VAPT, Cloud and Kubernetes Security, Cyber Forensics. CySA+ & CEH Practicals