让你完全认识MySQL数据库中Show命令用法

来源:互联网 发布:java. 大数据 编辑:程序博客网 时间:2024/06/06 00:22
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
 

MySQL中有很多的基本命令Show命令也是其中之一,在很多使用者中对Show命令的使用还容易产生混淆,本文汇集了Show命令的众多用法。

a. Show tables或Show tables from database_name; -- 显示当前数据库中所有表的名称。

b. Show databases; -- 显示MySQL中所有数据库的名称。

c. Show columns from table_name from database_name; 或Show columns from database_name.table_name; -- 显示表中列名称。

d. Show grants for user_name; -- 显示一个用户的权限,显示结果类似于grant 命令

e. Show index from table_name; -- 显示表的索引。

f. Show status; -- 显示一些系统特定资源的信息,例如,正在运行的线程数量。

g. Show variables; -- 显示系统变量的名称和值。

h. Show processlist; -- 显示系统中正在运行的所有进程,也就是当前正在执行的查询。大多数用户可以查看他们自己的进程,但是如果他们拥有process权限,就可以查看所有人的进程,包括密码。

i. Show table status; -- 显示当前使用或者指定的database中的每个表的信息。信息包括表类型和表的最新更新时间。

j. Show privileges; -- 显示服务器所支持的不同权限。

k. Show create database database_name; -- 显示create database 语句是否能够创建指定的数据库。

l. Show create table table_name; -- 显示create database 语句是否能够创建指定的数据库。

m. Show engies; -- 显示安装以后可用的存储引擎和默认引擎。

n. Show innodb status; -- 显示innoDB存储引擎的状态。

o. Show logs; -- 显示BDB存储引擎的日志。

p. Show warnings; -- 显示最后一个执行的语句所产生的错误、警告和通知。

q. Show errors; -- 只显示最后一个执行语句所产生的错误。

r. Show [storage] engines; --显示安装后的可用存储引擎和默认引擎。<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击