Unable to connect to database error

If you are getting error messages in scripts please be sure that you have created a user in the cPanel MySQL hosting tool and that you have added the user to a database.  This must be done after the database is created to allow access to it.

 

cPanel adding MySQL user to databse

 

When a script needs database details, they will be of the form:

yourcpanelusername_databasename

yourcpanelusername_mysqluser

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Database times out when restoring

If you are trying to restore a large database either via phpMyAdmin or the cPanel backup tool it...

Database backup and restore in cPanel

In cPanel go to the Backups section. You can see the “Download a MySQL Database Backup” option,...

How to reset your cPanel / WHM password

Note for VPS Clients: Resetting your root password is done via SolusVM, please see this KB page....

Taking a full cPanel account backup

Once you have logged in to your cPanel hosting control panel choose the backup section. Click the...

Database times out when restoring

If you are trying to restore a large database either via phpMyAdmin or the cPanel backup tool it...