ERROR 3118 (HY000): Access denied for user. Account is locked.

Error: Access denied for user, Account is locked

mysql -u hr -p
Enter password: ************

ERROR 3118 (HY000): Access denied for user 'hr'@'localhost'. Account is locked.

Solution: Login with Root user and unlock the account.

--Check the Status of User is locked.
SELECT user, host, account_locked
 FROM mysql.user
 WHERE user = 'hr';

--Unlock the User account
ALTER USER 'hr'@'localhost' ACCOUNT UNLOCK;

Check the number of attempts for the locked accounts

SHOW GLOBAL STATUS LIKE 'Locked_connects';

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.