Introduction

Losing access to a WordPress admin account can prevent you from managing your website, updating content, or performing maintenance tasks. Fortunately, WordPress provides multiple ways to reset the administrator password. Depending on the level of access available, you can reset the password through the WordPress login page, phpMyAdmin, WP-CLI, or directly from the database.

This guide explains the common methods to safely reset a WordPress admin password.

Prerequisites

Before proceeding, ensure you have the following:

  • Access to the WordPress website or hosting account
  • WordPress administrator username or registered email address
  • Access to cPanel, phpMyAdmin, or SSH (for advanced methods)
  • Database credentials (if resetting through the database)
  • Backup of the website and database before making changes

IMPLEMENTATION

Reset WordPress admin password using database:

 1. Find the database name in “wp-config.php” for the corresponding WP domain.

2. cd /var/lib/mysql

3. Take backup
   mysqldump databasename > databasename.sql

4. Enter into MySQL prompt.
   mysql

root@hostname# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2859662
Server version: 5.1.56-log MySQL Community Server (GPL)

mysql>

mysql> use databasename;

mysql> show tables;

5.check for ‘wp_users’ table.

mysql> select * from wp_users; (To check username)

mysql> update wp_users set user_pass=MD5(‘GIVE_STRONG_ADMIN_PASSWORD_HERE’) where  user_login=”admin”;

mysql> quit.

Now, try to access WordPress using new password.
Â

Conclusion

Resetting a WordPress admin password is a straightforward process when the correct access methods are available. The “Lost Password” feature is the simplest option, while phpMyAdmin, WP-CLI, and MySQL methods are useful when email access is unavailable. Always ensure proper backups are taken before making database-level changes to avoid accidental issues.

Leave a Reply