We will create a PHP script to reset our admin password in Joomla.
Using a text editor enter the code exactly as illustrated here. Now select the Save menu option.
Give the file a name like ‘resetadmin.php’ and then upload it to your Joomla web site root or home directory.
Run the script by entering http://vvww.joomquery.com/resetadmin.php from your browser.
Now log in to your admin panel using the password you entered in the previously written script.
After logging in, select the User Manager icon.. Click the name of the account you just reset the password for. Here you can change the password and Save the record to update linked tables properly.
$username = "admin";
$conf = new JConfig();
$dblink = mysql_connect($conf->host, $conf->user, $conf->password);
mysql_query("UPDATE ($conf->dbprefix)users SET password = MD5("$password") WHERE username = '$username'");
CLICK TO SEE VIDEO FOR MORE DETAILS
Reenter your password in the Confirm Password field. Click the Save & Close button. You now know how to reset your Joomla admin password using a custom PHP script.