Database Connection Path Checklist for Apps and Websites
Many database errors are connection path errors. The application must know the correct database host, port, database name, username, password and network route. If one part is wrong, the app cannot talk to the database.
Core principle
A database connection is a chain. Application config, DNS or hostname, port, firewall, database listener, user authentication and privileges must all agree.
Checklist
- Find the application database config.
- Check database host value.
- Check database port.
- Check database name.
- Check database username.
- Check whether password was recently changed.
- Check whether database service is listening.
- Check firewall or network rules.
- Test login from the application server.
- Verify application works after connection test.
Reusable lesson
This applies to WordPress, Laravel, Node.js apps, Python APIs, n8n, dashboards and any service using MySQL, MariaDB or PostgreSQL.
When to Use This Checklist
Use this checklist when an app or website cannot connect to its database after migration, password change, firewall change or server restart.
Required Tools
Application config, database credentials, SSH access, database CLI, firewall rules, database service status
Before You Start
Do not reset database passwords before confirming host, port, database name and service status.
Structured Checklist Steps
- Find app config.
- Check host.
- Check port.
- Check database name.
- Check username.
- Check password history.
- Check database listener.
- Check firewall.
- Test CLI login.
- Verify application.
Verification Steps
- Database service is reachable.
- Credential test passes.
- Application config matches database settings.
- Firewall does not block required access.
- Application loads again.
Rollback Plan
If a connection config change breaks the app, restore the previous application config and test database login separately before editing again.
Common Mistakes
- Changing password first.
- Forgetting DB_HOST.
- Using wrong database name after migration.
- Ignoring firewall or bind address.
- Testing only from the wrong machine.
Related Commands
grep DB_ wp-config.php
sudo ss -tulpn | grep 3306
sudo systemctl status mysql
mysql -h 127.0.0.1 -P 3306 -u db_user -p db_name
sudo ufw status numbered