Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2023-09-06 20:57:11
forward
614 people have browsed it

我们如何查看存储在特定 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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template