Reset admin account without email

Hello !

I use metabase with docker. My container was stopped and to use metabase I need to login.
Unfortunately, I forgot my credentials. I saw that we can reset password with this command:
java -jar metabase.jar reset-password email@email.com

But I forgot the email used to create the admin account.
Is there a way to find the admin email to reset the password?

Thanks,
Aimen

Hi @aimen
You would need to access the application database table core_user to see the emails.
If you are using H2, then migrate away from that:
https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html

Hi @flamber, thanks for the answer. This will be my last option. But can we edit the H2 directly inside the docker container ?

@aimen The H2 default location on Docker is /metabase.db/metabase.db.mv.db - you can use DBeaver.io or similar to edit that.

Thank you @flamber :smile:

I used the tool provided by H2:

It’s a simple way to find the email and reset the password (with the reset-password provided by metabase).

Thank!

I got the email from the h2 admin panel, but when running java -jar metabase.jar reset-password my@email.com I'm getting a "check your spelling" error. I've double-checked and tried different emails from the user tables:

/app # java -jar metabase.jar reset-password my@email.com
Warning: environ value jdk-11.0.10+9 for key :java-version has been overwritten with 11.0.10
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
2021-04-29 00:18:30,346 INFO metabase.util :: Maximum memory available to JVM: 498.0 MB
2021-04-29 00:18:39,370 INFO util.encryption :: Saved credentials encryption is DISABLED for this Metabase instance. πŸ”“ 
 For more information, see https://metabase.com/docs/latest/operations-guide/encrypting-database-details-at-rest.html
2021-04-29 00:18:45,909 INFO metabase.core :: 
Metabase v0.38.4 (057b6bb release-x.38.x) 

Copyright Β© 2021 Metabase, Inc. 

Metabase Enterprise Edition extensions are NOT PRESENT.
2021-04-29 00:18:45,922 WARN metabase.core :: WARNING: You have enabled namespace tracing, which could log sensitive information like db passwords.
2021-04-29 00:18:45,938 WARN db.env :: WARNING: Using Metabase with an H2 application database is not recommended for production deployments. For production deployments, we highly recommend using Postgres, MySQL, or MariaDB instead. If you decide to continue to use H2, please be sure to back up the database file regularly. For more information, see https://metabase.com/docs/latest/operations-guide/migrating-from-h2.html
2021-04-29 00:18:45,942 INFO db.setup :: Verifying h2 Database Connection ...
2021-04-29 00:18:46,191 INFO db.setup :: Successfully verified H2 1.4.197 (2018-03-18) application database connection. βœ…
2021-04-29 00:18:46,191 INFO db.setup :: Running Database Migrations...
2021-04-29 00:18:46,194 INFO db.setup :: Setting up Liquibase...
2021-04-29 00:18:46,226 INFO db.setup :: Liquibase is ready.
2021-04-29 00:18:46,226 INFO db.liquibase :: Checking if Database has unrun migrations...
2021-04-29 00:18:47,494 INFO db.setup :: Database Migrations Current ...  βœ…
2021-04-29 00:18:47,516 INFO db.data-migrations :: Running all necessary data migrations, this may take a minute.
2021-04-29 00:18:47,527 INFO db.data-migrations :: Finished running data migrations.
Database setup took 1.6 s
Resetting password for my@email.com...

FAIL [[[No user found with email address 'my@email.com'. Please check the spelling and try again.]]]

@Raschid Well, you should migrate away from H2:
https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html
And emails are case sensitive, and only works for non-deactivated users.