MySQL Table--检查当前实例是否有外键/视图/触发器/事件

检查当前实例是否有外键/视图/触发器/事件等

## 检查非系统数据库外视图
SELECT * 
FROM information_schema.views
WHERE TABLE_SCHEMA NOT IN(‘information_schema‘,‘sys‘,‘performance_schema‘,‘mysql‘);


## 检查非系统数据库外触发器
SELECT * 
FROM information_schema.TRIGGERS
WHERE TRIGGER_SCHEMA NOT IN(‘information_schema‘,‘sys‘,‘performance_schema‘,‘mysql‘);

## 检查非系统数据库外外键
SELECT * 
FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
WHERE CONSTRAINT_SCHEMA IN(‘information_schema‘,‘sys‘,‘performance_schema‘,‘mysql‘);

## 检查非系统数据库外事件
SELECT * 
FROM information_schema.EVENTS
WHERE EVENT_SCHEMA NOT IN(‘information_schema‘,‘sys‘,‘performance_schema‘,‘mysql‘);

MySQL Table--检查当前实例是否有外键/视图/触发器/事件

上一篇:Caused by: java.sql.SQLException: 数据类型varchar和varbinary在add运算符中不兼容


下一篇:Ubuntu 18.04网络不通,netplan命令不存在