the database and database user names are preceded by your cpanel username. Therefore if your cpanel username is foo, and you defined database name bar, then in the config file you would define the database name as foo_bar .
You must also define, via cpanel, a database username, so if the username is bird, then in the config file, you would define the user as foo_bird.
You will also need to enter the password for the database user, and make sure that you assigned (via cpanel) the user to the database, and that you gave the user the appropriate level of permissions (for wordpress, give the user all permissions).