These cheatsheets serve as my personal quick reference. Therefore, they’re less organized than the box walkthroughs, but I’ve shared them in case others find them useful.
General MYSQL command line
login command
mysql -u <username> -p -h <remote_host> -P <port>
List databases and switch to database
show databases;use <database_name>
List fields of database
describe <database_name>
INSERT statement
INSERT INTO table_name VALUES (column1_value, column2_value, column3_value, ...); INSERT INTO table_name(column2, column3, ...) VALUES (column2_value, column3_value, ...);
DROP statement
DROP TABLE <table_name>;
ALTER statement
ALTER TABLE <table_name> ADD newColumn <datatype>;
UPDATE statement
UPDATE <table_name> SET column1=newvalue1, column2=newvalue2, ... WHERE <condition>;