How can I describe all tables in the database through one statement?

前端 未结 8 1948
天命终不由人
天命终不由人 2021-01-31 08:01

Is there any statement that can describe all tables in a database?

Something like this:

describe * from myDB;
相关标签:
8条回答
  • 2021-01-31 08:46

    because the other suggestions made very much mess on the screen or just did not do the trick here is a hack for a small db:

    describe table_a; describe table_b; describe table_c; 
    

    and so on

    0 讨论(0)
  • 2021-01-31 08:47

    By default, Mysql not describe all tables in the database. The main reason Database main intention Just decentralize power and take care of metadata, but not index the data.

    Connect to the database: mysql [-u username] [-h hostname] database-name

    To list all databases, in the MySQL prompt type: show databases

    Then choose the right database: use MyDB;

    List all tables in the database: show tables;

    Describe a table: desc table-name or describe table-name

    0 讨论(0)
提交回复
热议问题