How to reset Joomla admin password?




There can be many reasons to reset the Joomla admin password. For example, you forgot it and cannot edit it through the User Manager for some reason, or your site has been hacked, or something else. The reason is not important, the main task - reset Joomla admin password. In this tutorial, we are going to show you two ways to reset Joomla admin password.




Reset Joomla admin password through editing of database


Use the following methods to make changes in the MySQL database.




Method 1. Changing a password in the database


1. Log in to phpMyAdmin ➝ select your Joomla database.


2. Find and browse the table  _users ➝ find the user whose password you want to change click Edit


3. Enter your new password select the field type from varchar to MD5 ➝ click the button Go to save settings.




Method 2. Adding a new super admin user


1. Go to phpMyAdmin ➝ select your Joomla database click the SQL button to run the SQL query. 


2. Click on the displayed field Run SQL query/queries on database <your database> ➝ delete any text in this field copy and paste the following query below click the button Go.

INSERT INTO `jos31_users` (`name`, `username`, `password`, `params`, `registerDate`, `lastvisitDate`, `lastResetTime`)VALUES ('Administrator2', 'admin2', 'd2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199', '', NOW(), NOW(), NOW());INSERT INTO `jos31_user_usergroup_map` (`user_id`,`group_id`)VALUES (LAST_INSERT_ID(),'8');
  • jos31_ is the table name prefix example. Change all occurrences of jos31_ to the prefix your installation is using

3. Log in to your Joomla back end using the username admin2 and password secret


4. Go to the User Manager ➝ change the password add a valid email address to the account.

  • Check that all users are legitimate, especially any members of the Super Administrator group

Reset Joomla admin password through configuration.php file


1. Connect to your FTP server ➝ configuration.php file change the permissions of the configuration.php file from 444 to 644.


2. Download the file configuration.php.


3. Create temporary super administrator: open the file configuration.php ➝ add this line to the bottom of the list:

public $root_user='name';


* name is username with access level Author or higher for that you know the password.



4. Save the configuration.php file upload it back to the site.


5. Log in to the back end create a new super admin (or change the password of the administrator that you don't have the password for).


* If you create a new user, then you can block or delete the old one.



6. Tap to the link Click here to try to do it automatically in the alert box to remove the added line in the file configuration.php.


Or go back and delete the added line from the configuration.php file upload it back to the site.


7. Change the file permissions on the configuration.php file to 444.

Related articles