# Resetting the admin password

If you no longer remember the admin password **the only way to reset it is by changing it in the database**.

{% hint style="info" %}
For security purposes the password is stored in the database **SHA256 encrypted** and uses an **unique salt** per user.
{% endhint %}

## Steps to reset the password:

### A. Using the MySQL console

You can set a new password for the admin user using this MySQL query:

```sql
UPDATE ust_users SET password=SHA2(CONCAT(salt, 'NEW_PASSWORD'), 256) WHERE id=1;
```

{% hint style="info" %}
Make sure to replace `NEW_PASSWORD` with your actual password.\
If you want to reset the password using this command for a different user, you can change the "WHERE" statement to `name=username`.
{% endhint %}

### B. Using PHPMyAdmin:

1\. Access the **`ust_users`** table in your database.

2\. Copy the contents of the **`salt`** column from the admin user.

3\. Decide on your new password, and prefix it with the salt: **salt**MyNewPassword123

4\. Encrypt the salt+password as SHA256.&#x20;

{% hint style="info" %}
You can use an [online SHA256 encryption tool like this](https://passwordsgenerator.net/sha256-hash-generator/).
{% endhint %}

5\. Save that encrypted value in the password field.

#### **Example:**

So let's say the salt in the DB is **f57efb9fa449** and you want your new password to be **XXXyyyZZZ**

You concatenate them:  **f57efb9fa449XXXyyyZZZ**

Get the sha256 encrypted value using the site linked above: **`7ABE3FCED2D3A6FD77D4D703C3C24B6D1634B4F351380C0154A6ECA64AAE3EA4`**

Save the above hash in the `password` column of the admin user in the database:

![](https://mail.google.com/mail/u/0?ui=2\&ik=c8761517f4\&attid=0.1\&permmsgid=msg-a:r-6551002517205299543\&th=172d7b4ca46fad80\&view=fimg\&sz=s0-l75-ft\&attbid=ANGjdJ8_Lz5NF1_OF0irSLx_olhknqZLivNNrIJzBn_7NJRI5DCDmdn8soLIptYntCiQbEcnb8wxie9Z1qLxFZgRAXYtQAsst7Q_Ys5Vhet1kxgzchIiHmJFOh811wc\&disp=emb\&realattid=ii_k9r3meo81)

###
