• 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

  • 相关阅读:
    关于大文本(txt)导入sqlserver2008数据库的一点感想
    欲则不达
    记录下马上两年的大学吧
    osgi使用 equnix框架 Bridge方式搭建方法(部分来源于ibm网站)
    mavan deploy不出repository.xml
    在项目中使用maven私服
    playbook 若干问题
    Maven 3 Felix 4 Eclipse 的搭建与部署(部分转载自别人文章)
    wallwd
    很好的面试记录
  • 原文地址:https://www.cnblogs.com/chang09/p/16623553.html
Copyright © 2020-2023  润新知