Access denied for user ‘sunny’@’%’. Account is locked.
User present in the database seems to be locked as per error message received during the connectivity with the MySQL database.
1. You need to connect with the root user.
2. Check the status of user with following query.
mysql> SELECT user, host, account_locked FROM mysql.user where user = 'sunny';
+-------+------+----------------+ | user | host | account_locked | +-------+------+----------------+ | sunny | % | Y | +-------+------+----------------+ 1 row in set (0.00 sec)
3. Unlocked the user account of MySQL database.
-- Unlock
ALTER USER 'sunny'@'%' account unlock;
--lock
ALTER USER 'sunny'@'%' account lock;
4. Verify the status of user.
mysql> SELECT user, host, account_locked FROM mysql.user where user = 'sunny';
+-------+------+----------------+ | user | host | account_locked | +-------+------+----------------+ | sunny | % | N | +-------+------+----------------+ 1 row in set (0.00 sec)