Skip to content

Instantly share code, notes, and snippets.

@vlntsolo
Last active May 23, 2021 13:31
Show Gist options
  • Save vlntsolo/cf7ba1733e3e65dc408adb0e55b0c613 to your computer and use it in GitHub Desktop.
Save vlntsolo/cf7ba1733e3e65dc408adb0e55b0c613 to your computer and use it in GitHub Desktop.
Simple MySQL cheatsheet (personal use/not comprehensive)

Short MySQL Cheatsheet

Command Description
SHOW DATABASES; List all databases
USE database; Choose database on which next commands will be performed
SHOW TABLES; List all tables in the database
SHOW TABLES LIKE pattern; Show tables that match the pattern i.e. permissions%
DESCRIBE table; Show all table column names and their types.
SELECT column FROM tabel; Basic SELECT statement to retieve rows from selected column
UPDATE table_name SET column_name = new_value WHERE condition; Update operation on selected column
UPDATE posts SET column_name = REPLACE(column_name, 'old_string', 'new_string'); Find/Replace operation on selecter column
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment