How to Reset the nopCommerce Administrator Account

Method 1: Change the Existing Administrator Account Password

  1. Log into your nopCommerce database with SQL Server Management Studio.


  2. Click on the New Query icon (or CTRL-N).


  3. Type in the following T-SQL code into the window.

    SELECT Id FROM dbo.Customer WHERE Username = '[email protected]'

    Replacing [email protected] with the administrator email account.  Hit F5 to run the query.  This will return a number in the Results window needed for the next step.


  4. Open another New Query window and enter this T-SQL code.

    UPDATE dbo.CustomerPassword SET PasswordSalt = '', PasswordFormatId = 0, Password = 'yournewpassword' WHERE CustomerId = Id

    Replacing yournewpassword with the password you want to set it to and Id with the results (i.e. number) obtained from Step 3.  This will allow you to log back in.  Then make sure you immediately change the password through the nopCommerce dashboard (Login > Customers > Customers > Edit > Change Password).

  5. Finally, go back into SQL Server Management Studio and run this T-SQL query.

    DELETE FROM dbo.CustomerPassword WHERE CustomerId = Id AND PasswordFormatId = 0

    Replacing Id with the results (i.e. number) from Step 3.  This step is important ( deleting of the plain text password ) as it will make it harder for the administrator account to be compromised.  If you skip this step, then administrator account will have 2 passwords with which you can use to login with.

Method 2: Create a Brand New User and Grant it Administrative Privileges

  1. Go to your site's Registration page to create a new account.


  2. Log into your nopCommerce database with SQL Server Management Studio.


  3. Click on the New Query icon (or CTRL-N).


  4. Type in the following T-SQL code into the window.

    SELECT Id FROM dbo.Customer WHERE Username = '[email protected]'

    Replacing [email protected] with the administrator email account.  Hit F5 to run the query.  This will return a number in the Results window needed for the next step.


  5. Open another New Query window and enter this T-SQL code.

    INSERT INTO dbo.Customer_CustomerRole_Mapping (Customer_Id, CustomerRole_Id) VALUES (Id, 1)

    Replacing Id with the results (i.e. number) from Step 4.  When you login with this account, you'll notice it has access to the Administration dashboard.  Use it to reset the other Administrator Account's password.  You can then delete this account and keep the original or vice versa.