Learning Traces...

--Great Love involves great effort
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Mysql 5 易忘的命令

Posted on 2010-01-22 15:48  suyang  阅读(441)  评论(0编辑  收藏  举报

一、查看所有数据库:show databases;

二、查看当前数据库的所有表:show tables; 或者:show table status; 或者:select * from information_schema.tables;

三、查看所有的存贮过程:select * from mysql.proc where db='db_name' and type='PROCEDURE'; 或者:show procedure status;

四、查看所有的函数:select * from mysql.proc where db='db_name' and type='FUNCTION'; 或者:show function status;

五、查看存贮过程的源码:show create procedure proc_name;

六、查看函数的源码:show create function func_name;

七、查看所有视图:select * from information_schema.views;

八、查看所有触发器:show triggers [from db_name] [like 'expr']; 或者:select * from information_schema.triggers;

九、查看表结构:desc tbl_name;