Posts tagged MYSQL COMMANDS

MYSQL COMMANDS

How to check mysql connection or  login to your Database using shell
=========================
[email protected][#] mysql -u username -p
=========================
it will ask for password then provide the correct password.

Create Database on the Mysql Server
=========================
mysql> create database [databasename];
=========================
ex : mysql>create database Dresses;

List all databases on the sql server.
===========================
mysql> show databases;
===========================

Switch to a database or use a database on the server .
===========================
mysql> use [database name];
===========================

To List all  tables in the  Database.
==========================
mysql> show tables;
==========================

To check the table Constraints or Describe table
==========================
mysql> describe [table name];
==========================

To Delete a Database
==========================
mysql> drop database [database name];
==========================

To delete a table.
==========================

mysql> drop table [table name];
==========================