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.
Watch this command run
Command transcript
This sanitized transcript shows the commands and output shape without exposing host details.
$ mysqladmin ping -h localhost -P 3306
mysqld is alive
$ mysqladmin status
Uptime: 86400 Threads: 7 Questions: 23890 Slow queries: 3 Opens: 112 Open tables: 64 Queries per second avg: 0.276
$ ss -ltnp | grep ':3306'
LISTEN 0 151 0.0.0.0:3306 0.0.0.0:* users:(("mysqld",pid=733,fd=22))
View commands shown
These are the commands shown in the sanitized transcript.
Commands shown
mysqladmin ping -h 127.0.0.1 -P 3306mysqladmin statusss -ltnp | grep ':3306'
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}' ./fixtures/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.
Useful for
- LPIC-1 style command-line practice
- LFCS style performance tasks
- Linux+ style troubleshooting review
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.