You will get this error if your website is not able to reach the database. This could either be due to a password authentication issue or the MySQL host might be down. What can you do?
Open the wp-config file from the File Manager in cPanel.
The portion you are looking for is this,
/** MySQL database username */
/** MySQL database password */
/** MySQL hostname */
These details much match those you have in cPanel under the MySQL section. Reset the database username and password. On our cPanel servers your host is always ‘localhost’.