MySQL 查询 数据库 所有 表 视图 存储过程 触发器 的 定义语句
1、查询 数据库 所有 表
use mysql;show tables; select table_name from information_schema.tables where table_schema = '数据库名' and table_type = 'base table'
2、查询 数据库 所有 视图
select table_name from information_schema.tables where table_schema = '数据库名' and table_type ='view'
3、查询 数据库 所有 存储过程
show procedure status where Db = 'uu898steam'; select name from mysql.proc where db = '数据库名' and type = 'procedure'; select `name` from mysql.proc where db = '数据库名' and `type` = 'procedure';
4、查询 数据库 所有 触发器
select * from information_schema.`triggers` SELECT * FROM information_schema.`TRIGGERS`
5、查询 函数 创建语句
show create function func_name;
6、查询 存储过程 定义语句
show create procedure sp_test;
show create procedure sp_checkalluserfunds;
7、查询 触发器 定义语句
select * from information_schema.triggers where trigger_name='触发器名';
8、history
-- test desc mysql.proc; select * from mysql.proc; select name from mysql.proc where db = 'uu898steam' and type ='procedure' select `name` from mysql.proc where db = 'uu898steam' and `type` = 'function'; desc mysql.func; select * from mysql.func; select `name` from mysql.func where `type` = 'function'; select `name` from mysql.func where `type` = 'aggregate';
————————————————
原文链接:https://blog.csdn.net/qq_18671415/article/details/109529744