2 minutes reading time (471 words)

Reset a Lost Joomla Admin Password

If you have lost your Joomla Super Administrator password and can't logon to your site, you have three options to try and recover or reset the account password.

1. Forgot your password 

You can use the forgot password option on the Joomla login page.

A verification code will be sent to your email address to allow you to reset the password.

2. Edit configuration.php 

You can edit the configuration.php file to temporarily give another Joomla user Super Administrator rights.

This method only works if you have another Joomla user account that you know the username and password for.  You'll need to edit your website's configuration.php either using SSH from the web server or by using SFTP to download and modify the file.

Edit configuration.php and add this line at the bottom of the file.

public $root_user='tempadmin';

Replace tempadmin with the username of the Joomla account that you know the password for.

The user will now be a temporary Super Administrator, you can login with this account and reset the password for the lost admin account.

3. Modify the database 

The last method to try is to edit the database directly and modify the _users table.

To do this you'll need admin access to the database and you'll need to know the Joomla database name and database tables prefix.

You can get the database tables prefix from within Joomla:

Global Configuration - Database settings

In this example, we're logging onto MariaDB as the root user.  You'll need to replace the database name and tables prefix in the commands below to match your database.

Joomla database demodb

Tables prefix df6h3_

Logon MariaDB shell as root

mysql -u root -p

Connect to the demodb database

use demodb;

Modify the df6h3_users table to create a new user admin2 with password secret

INSERT INTO `df6h3_users`
   (`name`, `username`, `password`, `params`, `registerDate`, `lastvisitDate`, `lastResetTime`)
VALUES ('Administrator2', 'admin2',
    'd2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199', '', NOW(), NOW(), NOW());
INSERT INTO `df6h3_user_usergroup_map` (`user_id`,`group_id`) 
VALUES (LAST_INSERT_ID(),'8'); 

Logout of MariaDB

quit

You will now be able to logon to Joomla using the new super administrator account admin2 with the password secret.

After you've logged in you can reset the Super admin users lost password and delete the temporary admin user.

Users - Manage

 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Saturday, 23 September 2023
You can help support this website by buying me a coffee!
Buy Me A Coffee