How to solve notorious ‘Error Establishing a Database Connection’ [closed]

did you change or modify any core WordPress files? just make sure that core files are not modified. and i suggest you to double check the wp-config.php file for DB Configurations.

restart your local server (apache & php).

Try with following configuration.

DB HOST: '127.0.0.1'
DB USER: 'root'
DB PASS: '' (blank)