How to solve the "Access denied for user ......" in drupal

Question: I am getting the following error in my new drupal application. How could I solve this problem?

PDOException: SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: YES) in lock_may_be_available() (line 167 of /home/lock.inc).

Answer: Update the password of PHPmyAdmin database and set it for the application.