mysql 查看信息的命令(show\desc\explain)

转自:http://blog.csdn.net/huangkq1989/article/details/7522713


1. 查看配置
show variable;
2.查看目前处理的列表;
show processlist;
3.看看有哪些存储过程
show procedure status;
4.查看一条命令的执行方案
explain select * fromt t_your_tabe;
如果是分区表
explain partitions select * from t_your_table;
5. 查看表的信息
desc t_your_table;
6.查看表的创建
show create table t_your_table;
7.查看存储过程的创建
show create procedure p_your_procedure
8.查看所有支持的字符集
use information_schema;
select * from character_sets;
实际上很多信息在mysql和information_schema可以查到
9. 索引
show index from t_your_table;
10. 主服务器
show master status;
11. 从服务器
show  slave status;
12. 查看日志 
show binary logs;
13. 查看状态
show status;
14. 查看user权限
show grant for u_user_name
15. 查看服务器支持的权限
show  privileges;

/*
 *2.记性是一回事,技巧是另一回事:
 */
使用帮助命令来查看自己的目标命名的使用方法
mysql> help search_string
If you provide an argument to the help command, mysql uses it as a search string to access server-side help from the contents of the MySQL Reference Manual. The
proper operation of this command requires that the help tables in the mysql database be initialized with help topic information 
If there is no match for the search string, the search fails:
mysql> help me
Nothing found
Please try to run ´help contents´ for a list of all accessible topics
Use help contents to see a list of the help categories:
mysql> help contents
You asked for help about help category: "Contents"
For more information, type help <item>, where <item> is one of the
following categories:
Account Management
Administration
Data Definition
Data Manipulation
Data Types
Functions
Functions and Modifiers for Use with GROUP BY
Geographic Features
Language Structure
Plugins
Storage Engines
Stored Routines
Table Maintenance
Transactions
Triggers
If the search string matches multiple items, mysql shows a list of matching topics:
mysql> help logs
Many help items for your request exist.
To make a more specific request, please type ´help <item>´,
   where <item> is one of the following topics:
   SHOW
   SHOW BINARY LOGS
   SHOW ENGINE
   SHOW LOGS

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值