怎么样information_schema.viewshttps:查看视图是否可更新
时间: 2023-06-10 11:07:57 浏览: 47
可以使用以下SQL查询来检查视图是否可更新:
```
SELECT is_updatable
FROM information_schema.views
WHERE table_schema = 'your_schema'
AND table_name = 'your_view';
```
其中,'your_schema'和'your_view'应替换为相应的模式和视图名称。如果查询结果为'YES',则视图是可更新的;如果结果为'NO',则视图不可更新。
相关问题
怎么使用information_schema.viewshttps
information_schema.views是MySQL数据库系统中的一个元数据表,它包含有关当前数据库中所有视图的信息。您可以使用该表来查询有关视图的信息,例如视图的名称、创建时间、列信息等。
下面是使用information_schema.views的一些示例:
1. 查询当前数据库中所有视图的名称:
```
SELECT table_name FROM information_schema.views WHERE table_schema = 'your_database';
```
2. 查询特定视图的列信息,例如视图名为my_view:
```
SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'my_view';
```
3. 查询特定视图的创建时间及其定义语句,例如视图名为my_view:
```
SELECT created, view_definition FROM information_schema.views WHERE table_name = 'my_view';
```
请注意,information_schema.views只提供有关当前数据库中的视图的信息。如果您希望查询其他数据库中的视图信息,则需要更改table_schema条件。
root@DESKTOP-0CU081I:/mysqld_exporter-0.12.1.linux-amd64# ./mysqld_exporter INFO[0000] Starting mysqld_exporter (version=0.12.1, branch=HEAD, revision=48667bf7c3b438b5e93b259f3d17b70a7c9aff96) source="mysqld_exporter.go:257" INFO[0000] Build context (go=go1.12.7, user=root@0b3e56a7bc0a, date=20190729-12:35:58) source="mysqld_exporter.go:258" INFO[0000] Enabled scrapers: source="mysqld_exporter.go:269" INFO[0000] --collect.global_status source="mysqld_exporter.go:273" INFO[0000] --collect.global_variables source="mysqld_exporter.go:273" INFO[0000] --collect.slave_status source="mysqld_exporter.go:273" INFO[0000] --collect.info_schema.innodb_cmp source="mysqld_exporter.go:273" INFO[0000] --collect.info_schema.innodb_cmpmem source="mysqld_exporter.go:273" INFO[0000] --collect.info_schema.query_response_time source="mysqld_exporter.go:273" INFO[0000] Listening on :9104 source="mysqld_exporter.go:283"
这段信息表明您已经成功启动了mysqld_exporter,并且它正在监听9104端口。mysqld_exporter是一个用于收集MySQL服务器指标的工具,它可以使用Prometheus进行监控。在您的情况下,mysqld_exporter已经启动并正在运行,您可以在Prometheus中配置它以收集MySQL指标并进行监控。如果您有任何其他问题,请随时问我。