PDOException::(“SQLSTATE[HY000] [1045] Access denied for user ‘root’@’localhost’ (using password: YES)”)

I find out that my mysql user didn’t have privileges on objects in the database.
Before that I changed my database password just to make the password characted easier to remember using following command:

SET PASSWORD FOR ‘test’@’localhost’ = PASSWORD(‘myeasypassword’)
After changing the password, I provided privileges on objects in the database by following command:

1 2 3 17