make sure that you prefix your database username and database password with your cpanel username. an example would be cpuser_dbuser and cpuser_dbname. Also, make sure that the user is added to the database. if you don't see a username next to the databse, then at the bottom of that page are 2 dropdown boxes and select the database and username you want to use.
-xP