Assuming that the user you want to use to access the database is called "user", check the following
1) Switch current db to mysql, and check if the user exists (there is a row having Host = % in the results of the following query)
USE mysql;
SELECT * FROM user WHERE user = 'user'
2) Check if this user has permissions for the database (there is a row having Db = database and host = %)
SELECT * FROM db WHERE user = 'user'
3) If this looks fine, try to flush privileges by the following:
FLUSH PRIVILEGES;
Then try to log in .. it may help.
The full step by step how to create a user and grant privileges is here: