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

前端 未结 8 2090
天命终不由人
天命终不由人 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: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

提交回复
热议问题