If you know the email address that was used for the admin user, and you have made the "lost password" feature available on the front end, the simplest thing is to do is to use the "lost password" Front-end function.

+

{{version|2.5,3.1}}

+

{{tip|This page is only for Joomla! 2.5 and higher versions. If you are still using Joomla! 1.5 instructions can be [[J1.5:How_do_you_recover_or_reset_your_admin_password%3F|found here]].|title=Joomla! 1.5 Password Recovery}}

−

If not, you will need access to the MySQL database. You have two choices, either add a new super administrator or change the password stored in the data base. To do this you need to go to phpMyAdmin (or use a similar tool) and manually edit the database. Before doing this ''back up your complete database''.

+

Normally, you can add, edit and delete users and passwords from the back-end User Manager. To do this, you must be logged in as a member of the Super Administrator group.

−

From phpMyAdmin, you can run this SQL query to create a new user known as <var>admin2</var>.

+

In some situations, this may not be possible. For example, your site may have been "hacked" and had the passwords or users changed. Or perhaps the person who knew the passwords is no longer available. Or maybe you have forgotten the password that was used.

−

<source lang="sql">

+

In these cases, it is still possible to alter the Joomla! database so you can log back in as a Super Administrator. These are the possible methods available to Joomla! administrators.

The password will be <var>admin</var>. Immediately log in and change this password and make any other changes to other admin users.

+

== Method 1: Configuration.php file ==

+

If you have access to your configuration.php file for the Joomla installation on your server, can recover the password using the following method.

−

A second option is to change the password in the table for your admin user. The password is stored in the MySQL database jos_users table password column. (Change this for your table prefix if different.)

+

1.) Using an FTP program connect to your site. Find the configuration.php file and look at the file permissions. If the permissions are 444 or some other value, then change the permissions of the configuration.php file to 644. This will help prevent issues when uploading the changed configuration.php file later in this process.

+

+

2.) Download the configuration file.

+

+

3.) Open the configuration.php file that was downloaded in a text editor such as notepad++ and add this line

+

+

public $root_user='myname';

+

+

to the bottom of the list where myname is a username with administrator access that you know the password for. An username that is Author level or higher can also be used in place of a username with administrator access.

+

+

4.) Save the configuration.php file and upload it back to the site. You may leave the permissions on the configuration.php file at 644.

+

+

This user will now be a temporary super administrator.

+

+

5.) Login to the back end and change the password of the administrator user you don't have the password for or create a new super admin user.

+

If you create the new user you may want to block or delete the old user depending on your circumstances.

+

+

6.) When finished, make sure to use the "Click here to try to do it automatically" link that appears in the alert box to remove the line that was added to the configuration.php file. If using the link was not successful, then go back and delete the added line from your configuration.php file using a text editor. Upload the configuration.php file back to the site.

+

+

7.) Using your FTP program verify the file permissions of the configuration.php file, they should be 444. If you manually removed the added line, then change the file permissions on the configuration.php file to 444.

+

+

If you have no users who know their passwords and you can't utilize front end registration you may need to make a change in your database as outlined below in this document.

+

+

== Method 2: Direct Editing of Database ==

+

If the methods above did not work, you have two other options, both of which require working with the MySQL database directly.

+

+

===Change the Password in the Database===

+

If the admin user is still defined, the simplest option is to change the password in the database to a known value. This requires that you have access to the MySQL database using phpMyAdmin or another client.

+

+

# Navigate to phpMyAdmin and select the database for the Joomla! site in the left-hand drop-down list box. This will show the database tables on the left side of the screen.

+

# Click on the table "jos_users" in the list of tables (note: you may have a prefix that is not jos_, simply go to the _users table for your prefix).

+

# Click on the "Browse" button in the top toolbar. This will show all of the users that are set up for this site.

+

# Find the user whose password you want to change and press the Edit icon for this row.

+

# A form will display that allows you to edit the password field. Copy the value <source lang="sql">d2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199</source> into the password field and press the ''Go'' button. phpMyAdmin should display the message "Affected rows: 1". At this point, the password should be changed to "secret".

+

# Log in with this user and password and change the password of this user to a secure value. Check all of the users using the User Manager to make sure they are legitimate. If you have been hacked, you may want to change all of the passwords on the site.

+

+

===Add a New Super Administrator User===

+

If changing the password won't work, or you aren't sure which user is a member of the Super Administrator group, you can use this method to create a new user.

+

+

# Navigate to phpMyAdmin and select the database for the Joomla! site in the left-hand drop-down list box. This will show the database tables on the left side of the screen.

+

# Press the "SQL" button in the toolbar to run an SQL query on the selected database. This will display a field called "Run SQL query/queries on database <your database>".

+

# Delete any text in this field and copy and paste one of the following queries and press the ''Go'' button to execute the query and add the new Administrator user to the table.

+

# Use the 1.6 query version for a site based upon Joomla 1.6.xx and use the 1.5 query version for a site based upon Joomla 1.5.xx.

+

+

+

'''NOTE:''' '''''The following code uses jos_ as the table name prefix which is the Joomla default table prefix If you elected to change this prefix when you first installed Joomla, you will need to change jos_ to the prefix you used.'''''

Open the table, find the row for your admin user, and then select that row for editing. The password must be hashed, you cannot simply enter text into this field.

+

At this point, you should be able to log into the back end of Joomla! with the username of "admin2" and password of "secret". After logging in, go to the User Manager and change the password to a new secure value and add a valid e-mail address to the account. If there is a chance you have been "hacked", be sure to check that all users are legitimate, especially any members of the Super Administrator group.

−

Set the password to one of the known values shown below:

+

{{warning|Warning: The password values shown on this page are public knowledge and are only for recovery. Your site may be hacked if you do not change the password to a secure value after logging in. Be sure you change the password to a secure value after logging in.}}

+

The examples above change the password to "secret". Two other possible values are shown below:

Revision as of 14:18, 18 October 2013

This page is only for Joomla! 2.5 and higher versions. If you are still using Joomla! 1.5 instructions can be found here.

Normally, you can add, edit and delete users and passwords from the back-end User Manager. To do this, you must be logged in as a member of the Super Administrator group.

In some situations, this may not be possible. For example, your site may have been "hacked" and had the passwords or users changed. Or perhaps the person who knew the passwords is no longer available. Or maybe you have forgotten the password that was used.

In these cases, it is still possible to alter the Joomla! database so you can log back in as a Super Administrator. These are the possible methods available to Joomla! administrators.

Contents

Method 1: Configuration.php file

If you have access to your configuration.php file for the Joomla installation on your server, can recover the password using the following method.

1.) Using an FTP program connect to your site. Find the configuration.php file and look at the file permissions. If the permissions are 444 or some other value, then change the permissions of the configuration.php file to 644. This will help prevent issues when uploading the changed configuration.php file later in this process.

2.) Download the configuration file.

3.) Open the configuration.php file that was downloaded in a text editor such as notepad++ and add this line

public $root_user='myname';

to the bottom of the list where myname is a username with administrator access that you know the password for. An username that is Author level or higher can also be used in place of a username with administrator access.

4.) Save the configuration.php file and upload it back to the site. You may leave the permissions on the configuration.php file at 644.

This user will now be a temporary super administrator.

5.) Login to the back end and change the password of the administrator user you don't have the password for or create a new super admin user. If you create the new user you may want to block or delete the old user depending on your circumstances.

6.) When finished, make sure to use the "Click here to try to do it automatically" link that appears in the alert box to remove the line that was added to the configuration.php file. If using the link was not successful, then go back and delete the added line from your configuration.php file using a text editor. Upload the configuration.php file back to the site.

7.) Using your FTP program verify the file permissions of the configuration.php file, they should be 444. If you manually removed the added line, then change the file permissions on the configuration.php file to 444.

If you have no users who know their passwords and you can't utilize front end registration you may need to make a change in your database as outlined below in this document.

Method 2: Direct Editing of Database

If the methods above did not work, you have two other options, both of which require working with the MySQL database directly.

Change the Password in the Database

If the admin user is still defined, the simplest option is to change the password in the database to a known value. This requires that you have access to the MySQL database using phpMyAdmin or another client.

Navigate to phpMyAdmin and select the database for the Joomla! site in the left-hand drop-down list box. This will show the database tables on the left side of the screen.

Click on the table "jos_users" in the list of tables (note: you may have a prefix that is not jos_, simply go to the _users table for your prefix).

Click on the "Browse" button in the top toolbar. This will show all of the users that are set up for this site.

Find the user whose password you want to change and press the Edit icon for this row.

A form will display that allows you to edit the password field. Copy the value

d2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199

into the password field and press the Go button. phpMyAdmin should display the message "Affected rows: 1". At this point, the password should be changed to "secret".

Log in with this user and password and change the password of this user to a secure value. Check all of the users using the User Manager to make sure they are legitimate. If you have been hacked, you may want to change all of the passwords on the site.

Add a New Super Administrator User

If changing the password won't work, or you aren't sure which user is a member of the Super Administrator group, you can use this method to create a new user.

Navigate to phpMyAdmin and select the database for the Joomla! site in the left-hand drop-down list box. This will show the database tables on the left side of the screen.

Press the "SQL" button in the toolbar to run an SQL query on the selected database. This will display a field called "Run SQL query/queries on database <your database>".

Delete any text in this field and copy and paste one of the following queries and press the Go button to execute the query and add the new Administrator user to the table.

Use the 1.6 query version for a site based upon Joomla 1.6.xx and use the 1.5 query version for a site based upon Joomla 1.5.xx.

NOTE:The following code uses jos_ as the table name prefix which is the Joomla default table prefix If you elected to change this prefix when you first installed Joomla, you will need to change jos_ to the prefix you used.

At this point, you should be able to log into the back end of Joomla! with the username of "admin2" and password of "secret". After logging in, go to the User Manager and change the password to a new secure value and add a valid e-mail address to the account. If there is a chance you have been "hacked", be sure to check that all users are legitimate, especially any members of the Super Administrator group.

Warning!

Warning: The password values shown on this page are public knowledge and are only for recovery. Your site may be hacked if you do not change the password to a secure value after logging in. Be sure you change the password to a secure value after logging in.

The examples above change the password to "secret". Two other possible values are shown below: