How to create a new admin account for Strapi?

I hoped that deleting the node-module folder and then running npm start would result in the initial dialog prompt to create the admin account. Instead, I am getting the prompt to login as the admin - and I lost the admin password.

Obviously, answering the forgot your password? question is not helping as I have not created the email component so far.

If you are using SQLite (quick start default) then you’ll need to open the file a client and delete entry in the strapi_administrators table (DBeaver community is a free, cross platform client that works well on any SQL database)

For others the same applies but need a client and the information to connect to the database server.

Email is likely failing (default it’s setup to use sendmail from your local machine) due to most ISPs blocking outbound port 25 to prevent email spam.

you’ll need to open the file a client

I tried to parse this a few times, without success, so let me see if I can guess the actions I need to take.

I need to open the data.db file in the <project root>/.tmp folder using DBeaver and remove the strapi_administrators table.

So, I installed DBeaver community edition - it seems a lot more complicated than say Microsoft’s SQL. This is a perception based on a few minutes long attempts to open this <project root>/.tmp/data.db. It seems that unless I am running it as administrator, nothing ever happens. If this is true that darn manual should say it before anything else.

So trying to save my back-end (Strapi) application database I tried to just recreate the admin user - and got stuck into mucking with DBeaver :japanese_ogre:

Sorry poorly written english on my phone (as I’m doing now)

Create a connection, select SQLite (it will probably ask you to download a connector, single button click will do so), then select the file (it’s as you said, the data.db).

Once you finish the connection wizard you’ll see it in the left menu, from there you can expand the tree to see the tables. Double click on the strapi_administrators one, select the data tab, select the row and at the bottom there is an option to delete the row. Then on the bottom right hit save.

(Fair warning I’m giving these instructions from memory, worst case a quick youtube search for DBeaver and SQLite should solve any questions).

Top left, to create connection. Then select SQLite:

Set the path to the SQLite Data.db file, use the test connection (this will prompt you to install the connector), then once test success, hit finish

Expand the new connection on the left and tables, select the strapi_administrator table, select the data tab, select the user in the list. At the bottom hit the delete row button, then hit save. Restart your Strapi server and it will prompt you to register a new user.

Derrick, this is super nice of you - I was very surprised to see your explanation. Not that I would get lost as I am pretty versed with Microsoft’s similar tools.

This thread may be of value to others in my situation (if there are any), who spent significant effort in building the backend database and lose the password. They would be happy to have a localhost equivalent of “lost password” that does not require working email

Yup we already have something bring worked on internally for this.

It seems that the Dbeaver on Windows does not work on Windows as you described:

Since I do not want to milk your time and this issue can be easily resolved by me using https://sqlitebrowser.org/ or something else that likes the Windows platform I will do that tomorrow.
Thank you again :wink:

Confirming success, using https://sqlitebrowser.org/about/ sqlite editor.

I recently asked a simalar question to this in the admin forum of strapi. Linked below

Click Here For Post Link

I am using the correct password and email and I am not able to log in or reset my password. Is there a way to reset my production build to get a new admin access(clearing the database I assume) and is it possible there is some kind of glitch in the login logic of my production strapi build? I used the same password as I did for my local instance and it works on my local instance just not in production?

Also works with PostgreSQL in production. I use adminer https://www.adminer.org/ to browse my db in hosted in render. Then delete admin_user only record. When I start develop mode strapi show the register account form I signed up and all was there.