Catalog / MySQL Cheatsheet
MySQL Cheatsheet
A comprehensive MySQL cheat sheet covering essential commands, data types, user management, and backup/restore procedures. Perfect for quick reference and efficient database management.
Basic Commands & Syntax
Browsing and Information
|
SELECT Statements
|
SELECT with JOIN
|
Common Conditions
`field1 = value1` |
Exact match |
`field1 <> value1` |
Not equal to value1 |
`field1 LIKE 'value %'` |
Matches ‘value’ followed by any characters |
`field1 IS NULL` |
Field is NULL |
`field1 IS NOT NULL` |
Field is not NULL |
`field1 IN (value1, value2)` |
Field is one of the specified values |
`condition1 AND condition2` |
Both conditions must be true |
`condition1 OR condition2` |
At least one condition must be true |
Database and Table Management
Database Operations
|
Table Creation
|
Table Alteration
|
Table Deletion
|
Data Manipulation
INSERT Statements
|
|
DELETE Statements
|
UPDATE Statements
|
User Management & Data Types
User and Privileges
|
|
Note: Host |
Main Data Types
Integer Types |
TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT |
Floating-Point Types |
FLOAT(M,D), DOUBLE(M,D) |
Date and Time Types |
DATE, TIME, DATETIME, TIMESTAMP, YEAR |
String Types |
VARCHAR(size), TEXT, MEDIUMTEXT, LONGTEXT |
Binary Types |
BLOB, MEDIUMBLOB, LONGBLOB |
ENUM Type |
ENUM('value1', 'value2', ...) |
Backup and Restore & Root Password Reset
Backup and Restore
|
|
Resetting Root Password (If Forgotten)
This process might vary depending on your OS and MySQL version. Always consult the official documentation for the most accurate and safe procedure. |
Steps (General Guide): |
|
|
|
|
|
|
|