Steps to reset the wordpress admin login in database

Introduction

You can change the WordPress admin username and password directly from the MySQL database using SSH access.


Prerequisites

  • SSH access to the server
  • MySQL root access
  • Access to the WordPress installation directory

Implementation

Log in to the server and navigate to the website’s public_html folder.

Then execute the following commands:

vi wp-config.php

Check the database name used by WordPress and stop using it: q!

mysql
use “database” (database = name of the database )
show tables;
desc wp_users;
select ID, user_login, user_pass from wp_users;


For changing the username

update wp_users set user_login=’username’ where ID=1;


For changing the password

update wp_users set user_pass=md5(‘password’) where user_login=’username’;


Conclusion

Using MySQL commands, you can directly update the WordPress admin username and password from the database.

admin

Our team has expertise across software and web development, WordPress, e-commerce, mobile applications, UI/UX, cloud and infrastructure, DevOps, CI/CD, API integration, security, testing, automation, and technical support. The team also works with AI-based software solutions, LLMs, AI workflows, AI agents, and intelligent application development to help businesses automate processes and build smarter digital solutions. We focus on developing, deploying, maintaining, and optimising secure, scalable, and reliable technology solutions while helping businesses adopt modern technologies and drive digital transformation.

Leave a Reply

Scroll to Top