This error happened to the mysql user and password not being correct on file. Change the setting in LocalSettings.php. You can verify whether the details you have are correct by logging into the mysql database

mysql -u ''wikiuser'' -p ''wikipassword''

where of course you have to replace the user name and password with your own details.