MySQL Show Datadictionary of tables

前端 未结 6 1274
悲&欢浪女
悲&欢浪女 2021-01-13 09:40

I\'d like to show DataDictionary for entire tables in database.

SHOW COLUMNS
FROM `MyDataBase`.`MyTables` 
WHERE IN ( SELECT TABLE_NAME 
           FROM info         


        
6条回答
  •  长发绾君心
    2021-01-13 10:38

    Usually I prefer to take this with multiple DESC. I feel SHOW COLUMNS is bit slower than DESC table_name.

    So if want to get all the columns in some databases

    1. Loop thru SHOW TABLES FROM DB_NAME
    2. Loop thru all tables as DESC table_name

    In the same way, SHOW INDEXES is slower when compared to SHOW CREATE TABLE if you just want to see the indexes on a table

提交回复
热议问题