MySQL database gets all table names in the database

 

  1. 1. Get all table names in a single database in the database.

fixed format:

SELECT 

  table_name 

FROM

  information_schema.tables 

WHERE table_schema = 'gz_risk' //The name here is the name of the database that needs to be exported, and the others are in a fixed format

  AND table_type = 'base table' 

 

 

  1. 2. Get the names of all tables in the database:

What is obtained here is all tables in the entire database:

SELECT table_name FROM information_schema.TABLES 

 

 

  1. 3. Get all table names and Chinese names in a single database in mysql database :

  
SELECT table_name, table_type, TABLE_COMMENT,

  FROM information_schema.tables

  WHERE table_schema = 'gz_risk' //Current database name

  ORDER BY table_name DESC;

 

 

 

 

Guess you like

Origin blog.csdn.net/Tank_666/article/details/90257925