1. Whatever CMS you are using should have a config , configuration, settings .ini or .php file.
Make sure the database host is set in that file to 'localhost'
2. If it is already set to localhost, go to cPanel, mySQL Databases tool, drop the db user from the db and then add him back, making...