1. 程式人生 > >MySQL 獲取資料庫中的所有表名和列名

MySQL 獲取資料庫中的所有表名和列名

sql語句在MySQL獲取資料庫裡的所有表名:

select table_name from information_schema.tables where table_schema='資料庫名'

sql語句在MySQL獲取資料庫表的所有列名:

select column_name from information_schema.columns where table_schema='資料庫名' and table_name='表名';