These steps are for a server with root access. They are not available on shared hosting.
Databases
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
systemctl start mariadb
journalctl -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';
SHOW VARIABLES LIKE 'max_connections';
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.
