Home > Database > Mysql Tutorial > body text

MySQL数据库中Show命令用法详解

WBOY
Release: 2016-06-07 16:20:16
Original
1438 people have browsed it

MySQL中有很多的基本命令,show命令也是其中之一,在很多使用者中对show命令的使用还容易产生混淆,本文汇集了show命令的众多用法。 a. show tables或show tables from database_name; -- 显示当前数据库中所有表的名称。 b. show databases; -- 显示mysql中

   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; --显示安装后的可用存储引擎和默认引擎。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!