MySQL Common Commands Cheat Sheet
MySQL Common Commands Cheat Sheet
Database Operations
| Command | Description |
|---|---|
CREATE DATABASE |
Create a new database |
DROP DATABASE |
Delete a database |
SHOW DATABASES |
Display all databases |
Table Management
| Command | Description |
|---|---|
CREATE TABLE |
Create a new table |
DROP TABLE |
Delete a table |
SHOW TABLES |
Display all tables in the current database |
Query Optimization
| Command | Description |
|---|---|
EXPLAIN |
Show query execution plan |
ANALYZE TABLE |
Analyze table performance |
User Management
| Command | Description |
|---|---|
CREATE USER |
Create a new user |
DROP USER |
Delete a user |
GRANT |
Grant permissions |
REVOKE |
Revoke permissions |
Backup & Recovery
| Command | Description |
|---|---|
mysqldump |
Backup database |
mysql |
Recover/Restore database |