WordPress: Error establishing a database connection
The entire site and WordPress panel show a message about the lack of connection to the database.
How to identify the source of the problem
Check DB HOST, DB NAME, DB USER and DB PASSWORD in wp-config.php without publishing passwords.
Check the bug log, recent plugin changes and the environment version on the site test copy.
Repair steps
Restore the correct connection, check MySQL server status and DB account permissions.
How to Test Solution
Frontend and wp-admin are running, and the wrong password is still blocked by the base.
Security and restrictions
Make a backup before you migrate or update PHP. Do not enter access data in untrusted forms.