Most useful MySQL Commands

List of most useful MySQL Commands

Posted by Amritpal Singh on October 24, 2017

This article is designed to be used as a reference for most useful MySQL commands and is regularly updated for improvements.

Connect to MySQL RDBMS using Terminal

mysql -h hostname -u username -p


Create a new database

mysql> create database DB_NAME;


Show all databases on the server

mysql> show databases;


Access a specific database

mysql> use DB_NAME;


List tables in a database

mysql> show tables;


Get the table structure

mysql> describe TABLE_NAME;


Delete a database

mysql> drop database DB_NAME;


Delete a table

mysql> drop table TABLE_NAME;

0 Comments


Add Comment