servername = localhost
username = cpanelusrname_databaseusrname
databasename = cpanelusrname_database
password = password for cpanelusrname_databaseusrname not cpanelusrname
databasename and username should be linked with required privileges set.
Check your database user password (not cpanel user password).
Grant cpanelusrname_databaseusername all the required privileges to the cpanelusrname_databasename.
Use :
cPanel >>MySQL Databases >> Current Databases
Click the cpanelusrname_databaseusername to open
MySQL Account Maintenance
Manage User Privileges
User: cpanelusrname_databaseusername
Database: cpanelusrname_databasename
Set the required PRIVILEGES (Just grant all PRIVILEGES)
---
Also, if the cpanelusrname_databaseusername alongside cpanelusrname_databasename doesn't show upin the above table ; use "Add User To Database" and click add.