Common Commands Cheat Sheet
MySQL / Redis / Nginx / Docker / K8s / Git / Linux / npm / Vim / Maven / Python / HTTP status codes
Service Management
sudo systemctl start mysql
sudo systemctl stop mysql
sudo systemctl restart mysql
sudo systemctl status mysql
brew services start mysql
Backup & Restore
mysqldump -u root -p --all-databases > backup.sql
mysqldump -u root -p database_name > db_backup.sql
mysql -u root -p database_name < backup.sql
mysqldump -u root -p database_name table_name > table_backup.sql
User Management
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost';
FLUSH PRIVILEGES;
DROP USER 'username'@'localhost';
Performance Monitoring
SHOW FULL PROCESSLIST;
SHOW VARIABLES LIKE 'slow_query_log';
SELECT table_schema AS 'Database', ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS 'Size (MB)' FROM information_schema.tables GROUP BY table_schema;
How to Use
Click a category tab to switch command groups, or use the search box for a fuzzy search. Click the Copy button to copy a command to the clipboard. Commands marked with ⚠️ should be verified in a test environment first, and the <parameter> placeholders in commands should be replaced with real values.
FAQ
Can the commands be copied straight into a terminal?
Yes. Each command has a "Copy" button that copies it to the clipboard. Note, however, that some commands use example formats (placeholders such as <your_password>, <database>), so replace them with real values before running; commands marked ⚠️ (e.g. rm -rf, DROP DATABASE) are risky, so make sure you understand them before running them carefully.
Which tech stacks are covered?
This cheat sheet covers 12 categories of tech stack: MySQL, Redis, Nginx, Docker, Docker Compose, Kubernetes (kubectl), Git, basic Linux commands, npm/npx, the Vim editor, Maven and Python/pip commands, plus common HTTP status codes. Each category is grouped by function and supports cross-category keyword search.
How do I handle the <parameter> placeholders in commands?
Anything wrapped in angle brackets (e.g. <database>, <table>) is a placeholder you need to replace. For example, in the MySQL command `SELECT * FROM <table> WHERE id = <id>;` you should substitute the real table name and ID value. Some parameters are optional (such as --flag options after a command); not every parameter has to be filled in.