HiveBrain v1.2.0
Get Started
← Back to all entries
debugsqlMinor

how to fix "your account is locked. please contact admin" issue in postgresql when login

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
fixcontactpostgresqlyouradminpleaseissuelockedloginaccount

Problem

I'm new to PostgreSQL.I'm using postgreSQL locally. I used it last time without any issues. Now, when I try login with my login credentials it shows the account is locked message all the time.

Solution

According to the pgadmin documentation there are two ways to unlock the user.

  1. Updating SQLite DB (pgAdmin4.db):



Locate the pgAdmin4.db file and open it using any DB Browser (or DB Browser for SQLite)

After opening the DB file, head towards ‘Execute SQL’ section.
Run below query :

UPDATE USER SET LOCKED = false, LOGIN_ATTEMPTS = 0 WHERE USERNAME = 


And make sure the query changes are committed.

  1. Increase the MAX_LOGIN_ATTEMPTS in the pgadmin configuration file config.py or preferably add a line in config_local.py



MAX_LOGIN_ATTEMPTS = 5

Code Snippets

UPDATE USER SET LOCKED = false, LOGIN_ATTEMPTS = 0 WHERE USERNAME = <YOUR_EMAIL_ID>
MAX_LOGIN_ATTEMPTS = 5

Context

StackExchange Database Administrators Q#299063, answer score: 5

Revisions (0)

No revisions yet.