WordPress displays « Error when connecting to the database ».
Probable causes
- Invalid MySQL identifiers
- MySQL server unavailable
- Saturated or corrupt base
- Incorrect base host
- Resource limit achieved
Verifications.
- Check wp-config.php — Control DB_NAME, DZ_USER, DZ_HOST without exposing secrets.
- Check basic service — Check the host’s status.
- Control the space and quotas — Saturation can prevent MySQL from working.
- See the logs — Identify the correct connection errors.
Solutions…
- Fix connection settings
- Restoring MySQL service
- Reveal a consistent basis if corruption confirmed