Yes, these types of connections are possible.
Did you create the database?
Did you create a user?
Did you add the user to the database?
You access the database like this.
dbname - cpanelname_databasenane
dbuser - cpanel_user
password - what you created