Skip to content

Instantly share code, notes, and snippets.

@yannbertrand
Last active April 6, 2017 13:45
Show Gist options
  • Save yannbertrand/6224abb25a20a92ffe04d4f8b7490e65 to your computer and use it in GitHub Desktop.
Save yannbertrand/6224abb25a20a92ffe04d4f8b7490e65 to your computer and use it in GitHub Desktop.
MySQL Cheat Sheet

MySQL Cheat Sheet

connect to MySQL as a root

$ mysql -u root -proot

show the list of databases

mysql> show databases;

use the database db_name

mysql> use db_name;

connect to database db_name as a root

$ mysql -u root -proot db_name

show the list of tables in current database

mysql> show tables;

display the structure of the table table_name

mysql> describe table_name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment