show tables;
DESCRIBE table_name; # To show table structure...
DESCRIBE my_table;
use database_name;
show tables;
Code language: SQL (Structured Query Language) (sql)
mysql -e 'show tables;' database_name
DESCRIBE table_name; /* List all columns of a database's table*/
Copied mysql> DESCRIBE pet;
+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| name | varchar(20) | YES | | NULL | |
| owner | varchar(20) | YES | | NULL | |
| species | varchar(20) | YES | | NULL | |
| sex | char(1) | YES | | NULL | |
| birth | date | YES | | NULL | |
| death | date | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+
# First, select your database
USE yourDb;
# Then, simply
SHOW TABLES;