码迷,mamicode.com
首页 > 数据库 > 详细

(DBA之路【四】)mysql show 指令集合

时间:2015-06-12 01:09:54      阅读:809      评论:0      收藏:0      [点我收藏+]

标签:server   二进制   开发者   mysql   信息   

1)show authors\G;

顾名思义显示开发者的各种信息。


2)SHOW BINARY/MASTER LOGS

显示server上的二进制日志文件


3)SHOW BINLOG EVENTS [IN ‘log_name‘] [FROM pos] [LIMIT [offset,] row_count]

显示二进制文件的相关信息。如果未指定日志文件名,则默认展示第一个二进制文件相关信息;其中LIMIT语法同SELECT.


4)SHOW CHARACTER SET [LIKE ‘pattern‘ | WHERE expr]

show character set显示MYSQL中的所有字符集信息。可用LIKEWHERE子句进行过滤。如 show character set like ‘u%’,列出所有以u开头的字符集.


5)SHOW COLLATION [LIKE ‘pattern‘ | WHERE expr]

show collation 显示所有的排序规则。可用LIKEWHERE子句进行过滤。如 show collation like ‘u%’,列出所有以u开头的排序规则.


6)SHOW [FULL] COLUMNS {FROM | IN} tbl_name [{FROM | IN} db_name] 

[LIKE ‘pattern‘ | WHERE expr]


e.g:mysql> SHOW columns FROM luna IN test;

+-------+-------------+------+-----+---------+-------+
| Field | Type        | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| id    | int(11)     | YES  |     | NULL    |       |
| name  | varchar(11) | YES  |     | NULL    |       |
+-------+-------------+------+-----+---------+-------+

显示某个数据库的某张表的列的信息,可通过likewhere子句过虑。from tbl_naem in db_name可用db_name.tbl_name替代。


7)SHOW CONTRIBUTORS


8)SHOW CREATE {DATABASE | SCHEMA} db_name

显示指定数据库的create database语句;其中database==schema.


e.g:

mysql> show create database test;
+----------+-----------------------------------------------------------------+
| Database | Create Database                                                 |
+----------+-----------------------------------------------------------------+
| test     | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ |
+----------+-----------------------------------------------------------------+


9)SHOW CREATE EVENT event_name

  显示指定event的create event语句.


10)SHOW CREATE FUNCTION func_name

  显示指定func_name的create function语句


e.g:

mysql> show create function f1;
+----------+----------+-------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
| Function | sql_mode | Create Function                                                                                                                     | character_set_client | collation_connection | Database Collation |
+----------+----------+-------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
| f1       |          | CREATE DEFINER=`root`@`localhost` FUNCTION `f1`(s CHAR(20)) RETURNS char(50) CHARSET latin1
BEGIN
RETURN CONCAT(‘aloha‘,s,‘!‘);
END | utf8                 | utf8_general_ci      | latin1_swedish_ci  |
+----------+----------+-------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
1 row in set (0.20 sec)


11)SHOW CREATE PROCEDURE proc_name

  显示指定proc_name的create procedure语句

e.g:

mysql> show create function f1;
+----------+----------+-------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
| Function | sql_mode | Create Function                                                                                                                     | character_set_client | collation_connection | Database Collation |
+----------+----------+-------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
| f1       |          | CREATE DEFINER=`root`@`localhost` FUNCTION `f1`(s CHAR(20)) RETURNS char(50) CHARSET latin1
BEGIN
RETURN CONCAT(‘aloha‘,s,‘!‘);
END | utf8                 | utf8_general_ci      | latin1_swedish_ci  |
+----------+----------+-------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
1 row in set (0.20 sec)


12)SHOW CREATE TABLE tbl_name

  显示指定tal_name的create table语句.

e.g:

mysql> show create function f1;
+----------+----------+-------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
| Function | sql_mode | Create Function                                                                                                                     | character_set_client | collation_connection | Database Collation |
+----------+----------+-------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
| f1       |          | CREATE DEFINER=`root`@`localhost` FUNCTION `f1`(s CHAR(20)) RETURNS char(50) CHARSET latin1
BEGIN
RETURN CONCAT(‘aloha‘,s,‘!‘);
END | utf8                 | utf8_general_ci      | latin1_swedish_ci  |
+----------+----------+-------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
1 row in set (0.20 sec)



13)SHOW CREATE TRIGGER trigger_name

  显示指定trigger_name的create trigger语句.


14)SHOW CREATE VIEW view_name

显示指定view_name的create view语句.


15)SHOW {DATABASES | SCHEMAS} [LIKE ‘pattern‘ | WHERE expr]

  show databases显示server上所有的数据库信息,可用like或where子句过虑;其中databases==schmas.


16)SHOW ENGINE engine_name {STATUS | MUTEX}

显示相关存储引擎的一些操作信息.


17)SHOW ERRORS [LIMIT [offset,] row_count]

   SHOW COUNT(*) ERRORS

    显示错误信息

    统计错误信息数量


18)SHOW EVENTS [{FROM | IN} schema_name][LIKE ‘pattern‘ | WHERE expr]

列出schema_name模式下,所有满足like或where条件的事件;Show events;列出当前模式下的所有事件.


19)SHOW FUNCTION CODE func_name

  显示存储函数func_name的code


e.g:

mysql> SHOW FUNCTION CODE f1;
ERROR 1289 (HY000): The ‘SHOW PROCEDURE|FUNCTION CODE‘ feature is disabled; you need MySQL built with ‘--with-debug‘ to have it working


solution:貌似没法,因为原来没有加debug设置,sigh~


20)SHOW FUNCTION STATUS [LIKE ‘pattern‘ | WHERE expr]

显示(满足like或where条件的)存储函数的状态信息

mysql> SHOW FUNCTION STATUS ;
+------+------+----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| Db   | Name | Type     | Definer        | Modified            | Created             | Security_type | Comment | character_set_client | collation_connection | Database Collation |
+------+------+----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| test | f1   | FUNCTION | root@localhost | 2015-05-04 21:55:23 | 2015-05-04 21:55:23 | DEFINER       |         | utf8                 | utf8_general_ci      | latin1_swedish_ci  |
+------+------+----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
1 row in set (0.00 sec)


21)SHOW GRANTS [FOR user]

显示权限

mysql> show grants for root@‘localhost‘;
+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost                                                                                                              |
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘localhost‘ IDENTIFIED BY PASSWORD ‘*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9‘ WITH GRANT OPTION |
| GRANT PROXY ON ‘‘@‘‘ TO ‘root‘@‘localhost‘ WITH GRANT OPTION                                                                           |
+----------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.01 sec)


22)SHOW {INDEX | INDEXES | KEYS}{FROM | IN} tbl_name [{FROM | IN} db_name][WHERE expr]

mysql> SHOW KEYS FROM dept IN test;
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| dept  |          0 | PRIMARY  |            1 | id          | A         |           4 |     NULL | NULL   |      | BTREE      |         |               |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+



23)show engine innodb status


24)SHOW MASTER STATUS

显示主机(相对于slave)的bin-log


25)SHOW OPEN TABLES [{FROM | IN} db_name][LIKE ‘pattern‘ | WHERE expr]

显示在表缓存中打开的,非临时表的信息

mysql> SHOW OPEN TABLES FROM test;
+----------+-----------+--------+-------------+
| Database | Table     | In_use | Name_locked |
+----------+-----------+--------+-------------+
| test     | temper    |      0 |           0 |
| test     | orderitem |      0 |           0 |
| test     | person    |      0 |           0 |
| test     | shirt     |      0 |           0 |
| test     | user      |      0 |           0 |
| test     | luna      |      0 |           0 |
| test     | dept      |      0 |           0 |
| test     | orders    |      0 |           0 |
+----------+-----------+--------+-------------+
8 rows in set (0.00 sec)


26)SHOW PLUGINS

显示server插件信息

mysql> SHOW PLUGINS;
+--------------------------+----------+--------------------+---------+---------+
| Name                     | Status   | Type               | Library | License |
+--------------------------+----------+--------------------+---------+---------+
| binlog                   | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| mysql_native_password    | ACTIVE   | AUTHENTICATION     | NULL    | GPL     |
| mysql_old_password       | ACTIVE   | AUTHENTICATION     | NULL    | GPL     |
| MRG_MYISAM               | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| CSV                      | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| MyISAM                   | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| MEMORY                   | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| FEDERATED                | DISABLED | STORAGE ENGINE     | NULL    | GPL     |
| InnoDB                   | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| INNODB_TRX               | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_LOCKS             | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_LOCK_WAITS        | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_CMP               | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_CMP_RESET         | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_CMPMEM            | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_CMPMEM_RESET      | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_BUFFER_PAGE       | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_BUFFER_PAGE_LRU   | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_BUFFER_POOL_STATS | ACTIVE   | INFORMATION SCHEMA | NULL    | GPL     |
| ARCHIVE                  | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| BLACKHOLE                | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| PERFORMANCE_SCHEMA       | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
| partition                | ACTIVE   | STORAGE ENGINE     | NULL    | GPL     |
+--------------------------+----------+--------------------+---------+---------+
23 rows in set (0.00 sec)


27)SHOW PRIVILEGES

显示MYSQL SERVER支持的所有系统权限

mysql> SHOW PRIVILEGES;
+-------------------------+---------------------------------------+-------------------------------------------------------+
| Privilege               | Context                               | Comment                                               |
+-------------------------+---------------------------------------+-------------------------------------------------------+
| Alter                   | Tables                                | To alter the table                                    |
| Alter routine           | Functions,Procedures                  | To alter or drop stored functions/procedures          |
| Create                  | Databases,Tables,Indexes              | To create new databases and tables                    |
| Create routine          | Databases                             | To use CREATE FUNCTION/PROCEDURE                      |
| Create temporary tables | Databases                             | To use CREATE TEMPORARY TABLE                         |
| Create view             | Tables                                | To create new views                                   |
| Create user             | Server Admin                          | To create new users                                   |
| Delete                  | Tables                                | To delete existing rows                               |
| Drop                    | Databases,Tables                      | To drop databases, tables, and views                  |
| Event                   | Server Admin                          | To create, alter, drop and execute events             |
| Execute                 | Functions,Procedures                  | To execute stored routines                            |
| File                    | File access on server                 | To read and write files on the server                 |
| Grant option            | Databases,Tables,Functions,Procedures | To give to other users those privileges you possess   |
| Index                   | Tables                                | To create or drop indexes                             |
| Insert                  | Tables                                | To insert data into tables                            |
| Lock tables             | Databases                             | To use LOCK TABLES (together with SELECT privilege)   |
| Process                 | Server Admin                          | To view the plain text of currently executing queries |
| Proxy                   | Server Admin                          | To make proxy user possible                           |
| References              | Databases,Tables                      | To have references on tables                          |
| Reload                  | Server Admin                          | To reload or refresh tables, logs and privileges      |
| Replication client      | Server Admin                          | To ask where the slave or master servers are          |
| Replication slave       | Server Admin                          | To read binary log events from the master             |
| Select                  | Tables                                | To retrieve rows from table                           |
| Show databases          | Server Admin                          | To see all databases with SHOW DATABASES              |
| Show view               | Tables                                | To see views with SHOW CREATE VIEW                    |
| Shutdown                | Server Admin                          | To shut down the server                               |
| Super                   | Server Admin                          | To use KILL thread, SET GLOBAL, CHANGE MASTER, etc.   |
| Trigger                 | Tables                                | To use triggers                                       |
| Create tablespace       | Server Admin                          | To create/alter/drop tablespaces                      |
| Update                  | Tables                                | To update existing rows                               |
| Usage                   | Server Admin                          | No privileges - allow connect only                    |
+-------------------------+---------------------------------------+-------------------------------------------------------+
31 rows in set (0.00 sec)


28)SHOW PROCEDURE CODE proc_name

该语句仅能在支持debugging扩展的server上执行。它展示的是一个内部实现的命名存储过程。


29)SHOW PROCEDURE STATUS [LIKE ‘pattern‘ | WHERE expr]

这个也是mysql的一个扩展功能,它展示的是一个存储过程的特有属性,如名字、类型、创建者、修改日期等等

mysql> SHOW PROCEDURE STATUS;
+------+------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| Db   | Name | Type      | Definer        | Modified            | Created             | Security_type | Comment | character_set_client | collation_connection | Database Collation |
+------+------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| test | p1   | PROCEDURE | root@localhost | 2015-05-04 21:07:06 | 2015-05-04 21:07:06 | DEFINER       |         | utf8                 | utf8_general_ci      | latin1_swedish_ci  |
| test | p2   | PROCEDURE | root@localhost | 2015-05-04 22:26:48 | 2015-05-04 22:26:48 | DEFINER       |         | utf8                 | utf8_general_ci      | latin1_swedish_ci  |
| test | p3   | PROCEDURE | root@localhost | 2015-05-05 08:52:48 | 2015-05-05 08:52:48 | DEFINER       |         | utf8                 | utf8_general_ci      | latin1_swedish_ci  |
| test | p4   | PROCEDURE | root@localhost | 2015-05-05 09:02:18 | 2015-05-05 09:02:18 | DEFINER       |         | utf8                 | utf8_general_ci      | latin1_swedish_ci  |
| test | p5   | PROCEDURE | root@localhost | 2015-05-05 09:21:28 | 2015-05-05 09:21:28 | DEFINER       |         | utf8                 | utf8_general_ci      | latin1_swedish_ci  |
+------+------+-----------+----------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
5 rows in set (0.00 sec)

30)SHOW [FULL] PROCESSLIST

展示sever上正在跑着的线程(这个很重要!)

mysql> SHOW PROCESSLIST;
+----+------+-----------+------+---------+------+-------+------------------+
| Id | User | Host      | db   | Command | Time | State | Info             |
+----+------+-----------+------+---------+------+-------+------------------+
| 38 | root | localhost | test | Query   |    1 | NULL  | SHOW PROCESSLIST |
+----+------+-----------+------+---------+------+-------+------------------+
1 row in set (0.04 sec)



31)SHOW PROFILE [type [, type] ... ]

    [FOR QUERY n]

    [LIMIT row_count [OFFSET offset]]

type:

    ALL

  | BLOCK IO

  | CONTEXT SWITCHES

  | CPU

  | IPC

  | MEMORY

  | PAGE FAULTS

  | SOURCE

  | SWAPS

显示会话中语句执行时的资源分配概要


32)SHOW SCHEDULER STATUS

相关事件调度的调试信息。适用于5.1.11调试版,在5.1.12及以后的版本不再支持该语句。



33)SHOW SLAVE HOSTS

展示在master上登记过的slave机器的相关信息



34)SHOW SLAVE STATUS

显示slave线程基本参数的状态信息



35)SHOW [GLOBAL | SESSION] STATUS [LIKE ‘pattern‘ | WHERE expr]

显示server的相关状态信息

mysql> SHOW GLOBAL STATUS;
+------------------------------------------+-------------+
| Variable_name                            | Value       |
+------------------------------------------+-------------+
| Aborted_clients                          | 0           |
| Aborted_connects                         | 1           |
| Binlog_cache_disk_use                    | 0           |
| Binlog_cache_use                         | 0           |
| Binlog_stmt_cache_disk_use               | 0           |
| Binlog_stmt_cache_use                    | 0           |
| Bytes_received                           | 8766        |
| Bytes_sent                               | 33028       |
| Com_admin_commands                       | 1           |
| Com_assign_to_keycache                   | 0           |
| Com_alter_db                             | 0           |
| Com_alter_db_upgrade                     | 0           |
| Com_alter_event                          | 0           |
| Com_alter_function                       | 0           |
| Com_alter_procedure                      | 0           |
| Com_alter_server                         | 0           |
| Com_alter_table                          | 0           |
| Com_alter_tablespace                     | 0           |
| Com_analyze                              | 0           |
| Com_begin                                | 0           |
| Com_binlog                               | 0           |
| Com_call_procedure                       | 0           |
| Com_change_db                            | 1           |
| Com_change_master                        | 0           |
| Com_check                                | 0           |
| Com_checksum                             | 0           |
| Com_commit                               | 0           |
| Com_create_db                            | 0           |
| Com_create_event                         | 0           |
| Com_create_function                      | 0           |
| Com_create_index                         | 0           |
| Com_create_procedure                     | 0           |
| Com_create_server                        | 0           |
| Com_create_table                         | 0           |
| Com_create_trigger                       | 0           |
| Com_create_udf                           | 0           |
| Com_create_user                          | 0           |
| Com_create_view                          | 0           |
| Com_dealloc_sql                          | 0           |
| Com_delete                               | 0           |
| Com_delete_multi                         | 0           |
| Com_do                                   | 0           |
| Com_drop_db                              | 0           |
| Com_drop_event                           | 0           |
| Com_drop_function                        | 0           |
| Com_drop_index                           | 0           |
| Com_drop_procedure                       | 0           |
| Com_drop_server                          | 0           |
| Com_drop_table                           | 0           |
| Com_drop_trigger                         | 0           |
| Com_drop_user                            | 0           |
| Com_drop_view                            | 0           |
| Com_empty_query                          | 0           |
| Com_execute_sql                          | 0           |
| Com_flush                                | 0           |
| Com_grant                                | 0           |
| Com_ha_close                             | 0           |
| Com_ha_open                              | 0           |
| Com_ha_read                              | 0           |
| Com_help                                 | 1           |
| Com_insert                               | 0           |
| Com_insert_select                        | 0           |
| Com_install_plugin                       | 0           |
| Com_kill                                 | 0           |
| Com_load                                 | 0           |
| Com_lock_tables                          | 0           |
| Com_optimize                             | 0           |
| Com_preload_keys                         | 0           |
| Com_prepare_sql                          | 0           |
| Com_purge                                | 0           |
| Com_purge_before_date                    | 0           |
| Com_release_savepoint                    | 0           |
| Com_rename_table                         | 0           |
| Com_rename_user                          | 0           |
| Com_repair                               | 0           |
| Com_replace                              | 0           |
| Com_replace_select                       | 0           |
| Com_reset                                | 0           |
| Com_resignal                             | 0           |
| Com_revoke                               | 0           |
| Com_revoke_all                           | 0           |
| Com_rollback                             | 0           |
| Com_rollback_to_savepoint                | 0           |
| Com_savepoint                            | 0           |
| Com_select                               | 70          |
| Com_set_option                           | 0           |
| Com_signal                               | 0           |
| Com_show_authors                         | 0           |
| Com_show_binlog_events                   | 0           |
| Com_show_binlogs                         | 0           |
| Com_show_charsets                        | 0           |
| Com_show_collations                      | 0           |
| Com_show_contributors                    | 0           |
| Com_show_create_db                       | 0           |
| Com_show_create_event                    | 0           |
| Com_show_create_func                     | 0           |
| Com_show_create_proc                     | 0           |
| Com_show_create_table                    | 0           |
| Com_show_create_trigger                  | 0           |
| Com_show_databases                       | 2           |
| Com_show_engine_logs                     | 0           |
| Com_show_engine_mutex                    | 0           |
| Com_show_engine_status                   | 1           |
| Com_show_events                          | 0           |
| Com_show_errors                          | 0           |
| Com_show_fields                          | 16          |
| Com_show_function_status                 | 2           |
| Com_show_grants                          | 3           |
| Com_show_keys                            | 2           |
| Com_show_master_status                   | 1           |
| Com_show_open_tables                     | 1           |
| Com_show_plugins                         | 1           |
| Com_show_privileges                      | 1           |
| Com_show_procedure_status                | 1           |
| Com_show_processlist                     | 1           |
| Com_show_profile                         | 1           |
| Com_show_profiles                        | 0           |
| Com_show_relaylog_events                 | 0           |
| Com_show_slave_hosts                     | 1           |
| Com_show_slave_status                    | 0           |
| Com_show_status                          | 1           |
| Com_show_storage_engines                 | 0           |
| Com_show_table_status                    | 0           |
| Com_show_tables                          | 2           |
| Com_show_triggers                        | 0           |
| Com_show_variables                       | 2           |
| Com_show_warnings                        | 0           |
| Com_slave_start                          | 0           |
| Com_slave_stop                           | 0           |
| Com_stmt_close                           | 0           |
| Com_stmt_execute                         | 0           |
| Com_stmt_fetch                           | 0           |
| Com_stmt_prepare                         | 0           |
| Com_stmt_reprepare                       | 0           |
| Com_stmt_reset                           | 0           |
| Com_stmt_send_long_data                  | 0           |
| Com_truncate                             | 0           |
| Com_uninstall_plugin                     | 0           |
| Com_unlock_tables                        | 0           |
| Com_update                               | 0           |
| Com_update_multi                         | 0           |
| Com_xa_commit                            | 0           |
| Com_xa_end                               | 0           |
| Com_xa_prepare                           | 0           |
| Com_xa_recover                           | 0           |
| Com_xa_rollback                          | 0           |
| Com_xa_start                             | 0           |
| Compression                              | OFF         |
| Connections                              | 39          |
| Created_tmp_disk_tables                  | 58          |
| Created_tmp_files                        | 6           |
| Created_tmp_tables                       | 225         |
| Delayed_errors                           | 0           |
| Delayed_insert_threads                   | 0           |
| Delayed_writes                           | 0           |
| Flush_commands                           | 1           |
| Handler_commit                           | 0           |
| Handler_delete                           | 0           |
| Handler_discover                         | 0           |
| Handler_prepare                          | 0           |
| Handler_read_first                       | 7           |
| Handler_read_key                         | 1           |
| Handler_read_last                        | 0           |
| Handler_read_next                        | 24          |
| Handler_read_prev                        | 0           |
| Handler_read_rnd                         | 0           |
| Handler_read_rnd_next                    | 1181        |
| Handler_rollback                         | 0           |
| Handler_savepoint                        | 0           |
| Handler_savepoint_rollback               | 0           |
| Handler_update                           | 0           |
| Handler_write                            | 1133        |
| Innodb_buffer_pool_pages_data            | 328         |
| Innodb_buffer_pool_bytes_data            | 5373952     |
| Innodb_buffer_pool_pages_dirty           | 0           |
| Innodb_buffer_pool_bytes_dirty           | 0           |
| Innodb_buffer_pool_pages_flushed         | 0           |
| Innodb_buffer_pool_pages_free            | 7864        |
| Innodb_buffer_pool_pages_misc            | 0           |
| Innodb_buffer_pool_pages_total           | 8192        |
| Innodb_buffer_pool_read_ahead_rnd        | 0           |
| Innodb_buffer_pool_read_ahead            | 0           |
| Innodb_buffer_pool_read_ahead_evicted    | 0           |
| Innodb_buffer_pool_read_requests         | 3557        |
| Innodb_buffer_pool_reads                 | 329         |
| Innodb_buffer_pool_wait_free             | 0           |
| Innodb_buffer_pool_write_requests        | 0           |
| Innodb_data_fsyncs                       | 3           |
| Innodb_data_pending_fsyncs               | 0           |
| Innodb_data_pending_reads                | 0           |
| Innodb_data_pending_writes               | 0           |
| Innodb_data_read                         | 7573504     |
| Innodb_data_reads                        | 339         |
| Innodb_data_writes                       | 3           |
| Innodb_data_written                      | 1536        |
| Innodb_dblwr_pages_written               | 0           |
| Innodb_dblwr_writes                      | 0           |
| Innodb_have_atomic_builtins              | ON          |
| Innodb_log_waits                         | 0           |
| Innodb_log_write_requests                | 0           |
| Innodb_log_writes                        | 1           |
| Innodb_os_log_fsyncs                     | 3           |
| Innodb_os_log_pending_fsyncs             | 0           |
| Innodb_os_log_pending_writes             | 0           |
| Innodb_os_log_written                    | 512         |
| Innodb_page_size                         | 16384       |
| Innodb_pages_created                     | 0           |
| Innodb_pages_read                        | 328         |
| Innodb_pages_written                     | 0           |
| Innodb_row_lock_current_waits            | 0           |
| Innodb_row_lock_time                     | 0           |
| Innodb_row_lock_time_avg                 | 0           |
| Innodb_row_lock_time_max                 | 0           |
| Innodb_row_lock_waits                    | 0           |
| Innodb_rows_deleted                      | 0           |
| Innodb_rows_inserted                     | 0           |
| Innodb_rows_read                         | 0           |
| Innodb_rows_updated                      | 0           |
| Innodb_truncated_status_writes           | 0           |
| Key_blocks_not_flushed                   | 0           |
| Key_blocks_unused                        | 14493       |
| Key_blocks_used                          | 4           |
| Key_read_requests                        | 18          |
| Key_reads                                | 4           |
| Key_write_requests                       | 0           |
| Key_writes                               | 0           |
| Last_query_cost                          | 0.000000    |
| Max_used_connections                     | 1           |
| Not_flushed_delayed_rows                 | 0           |
| Open_files                               | 48          |
| Open_streams                             | 0           |
| Open_table_definitions                   | 52          |
| Open_tables                              | 52          |
| Opened_files                             | 363         |
| Opened_table_definitions                 | 52          |
| Opened_tables                            | 215         |
| Performance_schema_cond_classes_lost     | 0           |
| Performance_schema_cond_instances_lost   | 0           |
| Performance_schema_file_classes_lost     | 0           |
| Performance_schema_file_handles_lost     | 0           |
| Performance_schema_file_instances_lost   | 0           |
| Performance_schema_locker_lost           | 0           |
| Performance_schema_mutex_classes_lost    | 0           |
| Performance_schema_mutex_instances_lost  | 0           |
| Performance_schema_rwlock_classes_lost   | 0           |
| Performance_schema_rwlock_instances_lost | 0           |
| Performance_schema_table_handles_lost    | 0           |
| Performance_schema_table_instances_lost  | 0           |
| Performance_schema_thread_classes_lost   | 0           |
| Performance_schema_thread_instances_lost | 0           |
| Prepared_stmt_count                      | 0           |
| Qcache_free_blocks                       | 1           |
| Qcache_free_memory                       | 16768392    |
| Qcache_hits                              | 0           |
| Qcache_inserts                           | 0           |
| Qcache_lowmem_prunes                     | 0           |
| Qcache_not_cached                        | 70          |
| Qcache_queries_in_cache                  | 0           |
| Qcache_total_blocks                      | 1           |
| Queries                                  | 167         |
| Questions                                | 167         |
| Rpl_status                               | AUTH_MASTER |
| Select_full_join                         | 0           |
| Select_full_range_join                   | 0           |
| Select_range                             | 0           |
| Select_range_check                       | 0           |
| Select_scan                              | 24          |
| Slave_heartbeat_period                   | 0.000       |
| Slave_open_temp_tables                   | 0           |
| Slave_received_heartbeats                | 0           |
| Slave_retried_transactions               | 0           |
| Slave_running                            | OFF         |
| Slow_launch_threads                      | 0           |
| Slow_queries                             | 0           |
| Sort_merge_passes                        | 0           |
| Sort_range                               | 0           |
| Sort_rows                                | 0           |
| Sort_scan                                | 0           |
| Ssl_accept_renegotiates                  | 0           |
| Ssl_accepts                              | 0           |
| Ssl_callback_cache_hits                  | 0           |
| Ssl_cipher                               |             |
| Ssl_cipher_list                          |             |
| Ssl_client_connects                      | 0           |
| Ssl_connect_renegotiates                 | 0           |
| Ssl_ctx_verify_depth                     | 0           |
| Ssl_ctx_verify_mode                      | 0           |
| Ssl_default_timeout                      | 0           |
| Ssl_finished_accepts                     | 0           |
| Ssl_finished_connects                    | 0           |
| Ssl_session_cache_hits                   | 0           |
| Ssl_session_cache_misses                 | 0           |
| Ssl_session_cache_mode                   | NONE        |
| Ssl_session_cache_overflows              | 0           |
| Ssl_session_cache_size                   | 0           |
| Ssl_session_cache_timeouts               | 0           |
| Ssl_sessions_reused                      | 0           |
| Ssl_used_session_cache_entries           | 0           |
| Ssl_verify_depth                         | 0           |
| Ssl_verify_mode                          | 0           |
| Ssl_version                              |             |
| Table_locks_immediate                    | 68          |
| Table_locks_waited                       | 0           |
| Tc_log_max_pages_used                    | 0           |
| Tc_log_page_size                         | 0           |
| Tc_log_page_waits                        | 0           |
| Threads_cached                           | 0           |
| Threads_connected                        | 1           |
| Threads_created                          | 1           |
| Threads_running                          | 1           |
| Uptime                                   | 3269        |
| Uptime_since_flush_status                | 3269        |
+------------------------------------------+-------------+
312 rows in set (0.02 sec)


36)SHOW TABLE STATUS [{FROM | IN} db_name] [LIKE ‘pattern‘ | WHERE expr]

有点类似于show tables,但该语提供了更多的非临时表的相关信息。

mysql> SHOW TABLE STATUS;
+-----------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-------------------+----------+----------------+---------+
| Name      | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time         | Update_time | Check_time | Collation         | Checksum | Create_options | Comment |
+-----------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-------------------+----------+----------------+---------+
| dept      | InnoDB |      10 | Compact    |    4 |           4096 |       16384 |               0 |            0 |   7340032 |              5 | 2015-05-03 10:27:07 | NULL        | NULL       | latin1_swedish_ci |     NULL |                |         |
| luna      | InnoDB |      10 | Compact    |    9 |           1820 |       16384 |               0 |            0 |   7340032 |           NULL | 2015-06-02 17:18:23 | NULL        | NULL       | latin1_swedish_ci |     NULL |                |         |
| orderitem | InnoDB |      10 | Compact    |    1 |          16384 |       16384 |               0 |        16384 |   7340032 |              2 | 2015-05-26 18:07:48 | NULL        | NULL       | latin1_swedish_ci |     NULL |                |         |
| orders    | InnoDB |      10 | Compact    |    3 |           5461 |       16384 |               0 |            0 |   7340032 |              4 | 2015-05-10 11:25:38 | NULL        | NULL       | latin1_swedish_ci |     NULL |                |         |
| person    | InnoDB |      10 | Compact    |    2 |           8192 |       16384 |               0 |            0 |   7340032 |              3 | 2015-06-07 15:25:06 | NULL        | NULL       | latin1_swedish_ci |     NULL |                |         |
| shirt     | InnoDB |      10 | Compact    |    7 |           2340 |       16384 |               0 |            0 |   7340032 |              8 | 2015-06-07 15:25:06 | NULL        | NULL       | latin1_swedish_ci |     NULL |                |         |
| temper    | InnoDB |      10 | Compact    |   36 |            455 |       16384 |               0 |            0 |   7340032 |           NULL | 2015-06-02 20:29:58 | NULL        | NULL       | latin1_swedish_ci |     NULL |                |         |
| user      | InnoDB |      10 | Compact    |   10 |           1638 |       16384 |               0 |        32768 |   7340032 |             12 | 2015-05-04 19:04:09 | NULL        | NULL       | latin1_swedish_ci |     NULL |                |         |
+-----------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-------------------+----------+----------------+---------+
8 rows in set (0.05 sec)



37)SHOW TRIGGERS [{FROM | IN} db_name] [LIKE ‘pattern‘ | WHERE expr]

列出某数据库内定义的triggers.



38)SHOW [GLOBAL | SESSION] VARIABLES [LIKE ‘pattern‘ | WHERE expr]

列出mysql的系统变量

请见DBA之路八


39)SHOW WARNINGS [LIMIT [offset,] row_count]

SHOW COUNT(*) WARNINGS

类似show errors;不过该语句显示的是当前会话中最后一个语句执行所产的的错误、警告等相关信息。





(DBA之路【四】)mysql show 指令集合

标签:server   二进制   开发者   mysql   信息   

原文地址:http://10170308.blog.51cto.com/10160308/1661029

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!