show a table in mysql code example

Example 1: mysql show all tables

show tables;

Example 2: mysql show table fields

DESCRIBE my_table;

Example 3: mysql command show tables

SHOW TABLES;

Example 4: mysql show create table

Copied mysql> SHOW CREATE TABLE t\G
*************************** 1. row ***************************
       Table: t
Create Table: CREATE TABLE `t` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `s` char(60) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4

Example 5: mysql command show tables

mysql -u user -p

Example 6: show tables mysql

Press CTRL+C to copy SHOW [EXTENDED] [FULL] TABLES
    [{FROM | IN} db_name]
    [LIKE 'pattern' | WHERE expr]

Tags:

Misc Example