Skip to content

Instantly share code, notes, and snippets.

@injune1123
Last active December 12, 2018 19:30
Show Gist options
  • Save injune1123/731e925a2017a40bbefa51c28427505f to your computer and use it in GitHub Desktop.
Save injune1123/731e925a2017a40bbefa51c28427505f to your computer and use it in GitHub Desktop.
Mysql Cheatsheet
mysql -u root
show databases;
// the default databases
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
//show the schema of a table
describe table_name;
create database db_name;
drop database db_name;
// unzip the db dump on mac
gunzip ${db_name}.sql.gz
//seed a db dump file into mysql
mysql -u root ${db_name} < ${path/db_name}.sql
//create a database
mysqladmin -uroot create ${dbname}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment