1. 程式人生 > >Mysql查看錶的結構相關命令

Mysql查看錶的結構相關命令

1、檢視某個資料庫dbtest中表table1的表結構。

mysql>show databases;

mysql>use dbtest;

mysql>show tables;

mysql>show create table table1;

2、只顯示資料庫中表的列。

mysql>show columns from table1;

3、顯示錶中欄位資訊

use information_schema;

select * from columns where table_name='table1';

4、顯示錶名中以‘table’為開頭的所有表。

show tables like 'table%';