How to use MySql from Terminal in Ubuntu machine

1). fist login by using

mysql -u root -p

let us see the all exisint databse We have till-

show databases;

and provide password for mysql

3). if you want to see the tables in a DB

use mydatabase_name;

4). next we may in the need to see the table os this database so type

show tables;

5). in case if we need to see the column in any table then type

SHOW COLUMNS FROM City;

or

show columns from city/managers;

Leave a Reply

Your email address will not be published. Required fields are marked *