Hosting Operations
Read-onlyCheck Whether MySQL Responds
An app cannot connect to MySQL and you need to distinguish a dead server from a credential or query issue.
Command
mysqladmin ping -h 127.0.0.1 -P 3306
Before you run this
System impact: Read-only. Low when scoped to the shown target.
When not to use it: Do not treat ping success as proof that app credentials or schema permissions are correct.
Expected output
A short response such as mysqld is alive.
System impact
Read-only. Nothing changes. mysqladmin reports whether the server responds.
Recovery / rollback: no state is changed.
When to use it
Use during deploys, restarts, and first-response database checks.
When not to use it
Do not treat ping success as proof that app credentials or schema permissions are correct.
next steps
Related commands
Check Whether PostgreSQL Is Accepting Connections
The database was running, but it was not ready.
pg_isready -h 127.0.0.1 -p 5432
Check Inodes When Disk Space Looks Fine
Sometimes the disk has free bytes but still cannot create files.
df -ih
Show Active MySQL Sessions
The app was waiting behind busy sessions.
mysql -e "show full processlist;"
Check PostgreSQL Lock Waits
The outage was a queue, not a crash.
psql -X -c "select pid, wait_event_type, wait_event, state, left(query, 80) as query from pg_stat_activity where wait_event_type is not null order by pid;"
Group Server Errors by URL Path
A 500 spike is easier to triage when the broken path is obvious.
awk '$9 ~ /^5/ {count[$7]++} END {for (path in count) print count[path], path}' /var/log/nginx/access.log | sort -nr | head
Study mapping
Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.