Last active
December 12, 2018 19:30
-
-
Save injune1123/731e925a2017a40bbefa51c28427505f to your computer and use it in GitHub Desktop.
Mysql Cheatsheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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