mysql show table columns code example

Example 1: show table columns mysql command line

SHOW COLUMNS from tablename;

Example 2: get the mysql table columns data type mysql

SHOW COLUMNS FROM mydb.mytable;

Example 3: MySql get fields of table

SELECT COLUMN_NAME
  FROM INFORMATION_SCHEMA.COLUMNS
  WHERE TABLE_SCHEMA = 'my_database' AND TABLE_NAME = 'my_table';

Example 4: mysql show table structure

DESCRIBE table_name; # To show table structure...

Example 5: mysql show table fields

DESCRIBE my_table;

Example 6: show table mysql

# First, select your database
USE yourDb;

# Then, simply
SHOW TABLES;

Tags:

Misc Example