SELECT*fromINFORMATION_SCHEMA.VIEWSWHERETABLE_NAME='Info'ANDTABLE_SCHEMA='query'\G****************** **********"/> SELECT*fromINFORMATION_SCHEMA.VIEWSWHERETABLE_NAME='Info'ANDTABLE_SCHEMA='query'\G****************** **********">

Home  >  Article  >  Database  >  How can we view the metadata of a view stored in a specific MySQL database?

How can we view the metadata of a view stored in a specific MySQL database?

WBOY
WBOYforward
2023-09-06 20:57:11597browse

我们如何查看存储在特定 MySQL 数据库中的视图的元数据?

INFORMATION_SCHEMA The database has a VIEWS table that contains view metadata, that is, data about the view. To illustrate this, let's take a view named "Info" as an example.

Example

The following query will display the metadata "Info" for a view named "Info" -

mysql> SELECT * from INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME = 'Info' AND TABLE_SCHEMA = 'query'\G
*************************** 1. row ***************************
TABLE_CATALOG: def
 TABLE_SCHEMA: query
   TABLE_NAME: info

VIEW_DEFINITION:select`query`.`student_info`.`id`AS`ID`,`query`.`student_info`.`Name` AS `NAME`,`query`.`student_info`.`Subject` AS `SUBJECT`,`query`.`
student_info`.`Address` AS `ADDRESS` from `query`.`student_info`
        CHECK_OPTION: NONE
        IS_UPDATABLE: YES
             DEFINER: root@localhost
       SECURITY_TYPE: DEFINER
CHARACTER_SET_CLIENT: cp850
COLLATION_CONNECTION: cp850_general_ci
1 row in set (0.00 sec)

The above is the detailed content of How can we view the metadata of a view stored in a specific MySQL database?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete