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