<ol>
<li><p>Download and install a fresh copy of Craft from <a href="http://buildwithcraft.com" rel="noreferrer">http://buildwithcraft.com</a> somewhere (doesn't matter if it's the same computer your existing site is on or not).</p></li>
<li><p>During installation, remember the password you entered when setting up the user.</p></li>
<li><p>Open the database and look in the <code>craft_users</code> table. Copy what's in the <code>password</code> column for the user that the installer created over to the <code>password</code> column in the <code>craft_users</code> table for the site you're trying to recover.</p></li>
<li><p>If the <code>locked</code>, <code>suspended</code>, <code>pending</code> or <code>archived</code> columns have <code>1</code> in them, set them to <code>0</code>.</p></li>
<li><p>If <code>lockoutDate</code> and/or <code>lastInvalidLoginDate</code> have values in them, delete them.</p></li>
<li><p>Login to the site you're trying to recover with the password you created in #2.</p></li>
</ol>

CC BY-SA 3.0
2015-07-18T13:53:45.663Z
This doesn't seem to work for craft 2.1.2564, is there a different procedure? Edit: It works fine ;)
maunoxyd
CC BY-SA 3.0
2015-03-09T00:10:18.100Z
2015-03-09T00:10:18.100Z
Brad Bell
<p>I'm rusty on MySQL so it took me a while to go through this. I'm leaving this here for future internet travelers. It's based on Brad's solution, so read through that first, then you can use these commands. If you forget what your database user/name is, go into Craft > App > Config > db.php</p>

<p>Login to MySQL on the command line:</p>

<pre><code>$ mysql -u craftuser -p
</code></pre>

<p>Choose the corrrect database:</p>

<pre><code>mysql&gt; USE craftdatabasename;
</code></pre>

<p>Make sure that the tablename is craft_users (it might be just users if you didn't use a prefix):</p>

<pre><code>mysql&gt; SHOW TABLES;
</code></pre>

<p>Show what the current hash is (you'll want to do this from your local install as well to compare and be able to copy in the new hash)</p>

<pre><code>mysql&gt; SELECT username,password FROM craft_users;
</code></pre>

<p>Update it to the new hash:</p>

<pre><code>mysql&gt; UPDATE craft_users SET password='passwordhash' WHERE username='admin';
</code></pre>

CC BY-SA 3.0
2016-11-15T23:39:41.330Z
2016-11-15T23:39:41.330Z
hisnameisjimmy
<p>Our developer hasn't been able to recover his password for the account he used to setup the site, and now he's non-responsive. The site is on my server and I have full access, but his account is the only one we setup.</p>

<p>We're not able to add new companies until we can either recover the account or setup a new one.</p>

<users><admin><password>
Recovering (or creating a new) admin account
# Recovering (or creating a new) admin account

(Asked by: username_0 on 2015-03-08)

Our developer hasn't been able to recover his password for the account he used to setup the site, and now he's non-responsive. The site is on my server and I have full access, but his account is the only one we setup.

We're not able to add new companies until we can either recover the account or setup a new one.

**Tags:** users, admin, password

---

## 2 answers

### Answer by username_1 on 2015-03-09. Score: 6

1. Download and install a fresh copy of Craft from <http://buildwithcraft.com> somewhere (doesn't matter if it's the same computer your existing site is on or not).
2. During installation, remember the password you entered when setting up the user.
3. Open the database and look in the `craft_users` table. Copy what's in the `password` column for the user that the installer created over to the `password` column in the `craft_users` table for the site you're trying to recover.
4. If the `locked`, `suspended`, `pending` or `archived` columns have `1` in them, set them to `0`.
5. If `lockoutDate` and/or `lastInvalidLoginDate` have values in them, delete them.
6. Login to the site you're trying to recover with the password you created in #2.

> **Comments:**
> **username_2**: This doesn't seem to work for craft 2.1.2564, is there a different procedure? Edit: It works fine ;)  

---

### Answer by username_3 on 2016-11-15. Score: 5

I'm rusty on MySQL so it took me a while to go through this. I'm leaving this here for future internet travelers. It's based on Brad's solution, so read through that first, then you can use these commands. If you forget what your database user/name is, go into Craft > App > Config > db.php
Login to MySQL on the command line:
$ mysql -u craftuser -p

Choose the corrrect database:
mysql> USE craftdatabasename;

Make sure that the tablename is craft_users (it might be just users if you didn't use a prefix):
mysql> SHOW TABLES;

Show what the current hash is (you'll want to do this from your local install as well to compare and be able to copy in the new hash)
mysql> SELECT username,password FROM craft_users;

Update it to the new hash:
mysql> UPDATE craft_users SET password='passwordhash' WHERE username='admin';


---

