查询指定库中所有表
/*查询指定库中所有表*/
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'mdm'/*库名*/
SELECT t.TABLE_NAME,t.TABLE_COLLATION FROM INFORMATION_SCHEMA.TABLES t WHERE t.table_schema = 'mdm'/*库名*/
/*查询指定表所有列*/
SELECT COUNT(*) FROM information_schema.columns col WHERE col.table_schema='mdm'/*库名*/ AND col.table_name='account'/*表名*/
SELECT col.COLUMN_NAME,col.DATA_TYPE, col.COLUMN_TYPE,col.COLUMN_DEFAULT,col.COLUMN_KEY FROM information_schema.columns col WHERE col.table_schema='mdm'/*库名*/ AND col.table_name='account'/*表名*/