Reset Mattermost

For feature requests, please see: Contributing Feature Proposals - Mattermost.

For troubleshooting questions, please post in the following format:

Summary

Hey everyone. I locked myself out of mattermost.
I have setup an mattermost installation on gitlab. But I forgot to save the password from the user (and the username)

Steps I took

I have tried to remove the database and reconfigure GitLab (and mattermost), but it fails to remove the database

When I do this I get:
ERROR: database “mattermost_production” is being accessed by other users
DETAIL: There are 5 other sessions using the database.

I can’t reset it using mail, since smtp is not yet enabled

Hello, @daansk44

Can you please try to revoke the future connections to the database first?

REVOKE CONNECT ON DATABASE mattermost_production FROM public;

Once done, go through the the current connections and can terminate all connections to this database except yours.

SELECT pid, pg_terminate_backend(pid) 
FROM pg_stat_activity 
WHERE datname = current_database() AND pid <> pg_backend_pid();

You should then be able to drop the database. Let me know how it goes on your end.