How do I reset the administrator password?

Normally you would use the user manager to add or change users. Sometimes though you may have forgotten your password or have been hacked and the password got changed on you. If that's the case here are three ways to get your access back.

Method 1

This method will get you access to the administrator without the use of a password. It does require you know a username of a user that is designated as an Author or higher to get in to the administrator.

  1. Use the cPanel file manager and navigate to /home/yoursite/public_html. If Joomla is installed in a sub-directory navigate to that folder.
  2. Edit the configuration.php file. It will likely be at 444 permissions, so you will need to change them to 644 before you'll be able to save changes.
  3. Add this line to the end of the list of lines that start with public

    public $root_user='myname';

    replace myname with your username you want to login with
  4. Now when you go to the administrator you'll be able to login with that user without using a password. You can use the user manager to change the password or create a new user.
  5. When you're done you will see a link that says "Click here to try to do it automatically". Click that to automatically remove the line you added to configuration.php.
  6. Go back to the cPanel file manager and make sure permissions for configuration.php are set to 444.

Method 2

If you don't know any of the administrator usernames on your site then you can use this method to find usernames and change the password using phpMyAdmin.
  1. In phpMyAdmin go to your database for Joomla
  2. Browse the table for jos_users (or replace jos_ with the database prefix you're using. If you're unsure you can find it in the configuration.php file)
  3. Find the row with the user you want to edit and click the edit button.
  4. Insert the following value in the password field

    d2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199

    The password for that user will now be secret.
  5. Login and make sure to change the password as soon as you can.

Method 3

If you're in a situation where all of your administrator users have been deleted, you can insert a new one directly from phpMyAdmin.
  1. In phpMyAdmin navigate to your Joomla database.
  2. Click the SQL tab and enter the folloowing query

    INSERT
    INTO `jos_users`
       (`name`, `username`, `password`, `params`)
    VALUES ('Administrator2', 'admin2',
        'd2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199', '');
    INSERT INTO `jos_user_usergroup_map` (`user_id`,`group_id`)
    VALUES (LAST_INSERT_ID(),'8');
  3. You will now be able to login with the username admin2 and the password secret.

Was this answer helpful?

 Print this Article

Also Read