This message is the same whether the password is wrong, the server is down, the disk is full or the connection limit is reached. Guessing between four is slower than testing, and the test is one command.
Test the credentials, not the site
mysql -u dbuser -p -h localhost dbname
- Access denied for user - wrong user or password, or the user has no grant on that database.
- Can't connect to local MySQL server - the service is not running.
- Unknown database - the name is wrong, or the database was never created on this server.
- Too many connections - the limit is reached.
Access denied
Read the credentials the site actually uses - not the ones you remember.
grep -E "DB_NAME|DB_USER|DB_PASSWORD|DB_HOST" wp-config.php
A password with a quote or a backslash in it is a common cause: it is right in the panel and wrong in the file, because the escaping was lost.
The service is not running
systemctl status mariadb\nsystemctl start mariadb\njournalctl -u mariadb --since "30 min ago" | tail -30
If it starts and stops again, the log names the reason. A full disk and a corrupt table are the two usual ones.
Too many connections
SHOW STATUS LIKE 'Threads_connected';\nSHOW VARIABLES LIKE 'max_connections';
Raising max_connections when the real problem is slow queries buys minutes. Each connection costs memory, and a server that runs out of RAM is worse than one that refuses a connection.
After a move
A database moved to another server usually needs DB_HOST changed from localhost to an address, and a user granted from that address rather than from localhost.
On EGPHP hosting the credentials are in EGPNL under Databases, and the panel shows the host the site should use. Copy from there rather than typing.