#### 13.7.7.37 SHOW STATUS Statement

[]()[]()[]()

```
SHOW [GLOBAL | SESSION] STATUS
    [LIKE 'pattern' | WHERE expr]
```

[]()

[`SHOW STATUS`](show-status.html) provides server status information (see [Section 5.1.10, “Server Status Variables”](server-status-variables.html)). This statement does not require any privilege. It requires only the ability to connect to the server.

 Status variable information is also available from these sources:

* Performance Schema tables. See [Section 27.12.15, “Performance Schema Status Variable Tables”](performance-schema-status-variable-tables.html).

* The [**mysqladmin extended-status**](mysqladmin.html) command. See [Section 4.5.2, “mysqladmin — A MySQL Server Administration Program”](mysqladmin.html).

 For [`SHOW STATUS`](show-status.html), a [`LIKE`](string-comparison-functions.html#operator_like) clause, if present, indicates which variable names to match. A `WHERE` clause can be given to select rows using more general conditions, as discussed in [Section 26.8, “Extensions to SHOW Statements”](extended-show.html).

[`SHOW STATUS`](show-status.html) accepts an optional `GLOBAL` or `SESSION` variable scope modifier:

* With a `GLOBAL` modifier, the statement displays the global status values. A global status variable may represent status for some aspect of the server itself (for example, `Aborted_connects`), or the aggregated status over all connections to MySQL (for example, `Bytes_received` and `Bytes_sent`). If a variable has no global value, the session value is displayed.

* With a `SESSION` modifier, the statement displays the status variable values for the current connection. If a variable has no session value, the global value is displayed. `LOCAL` is a synonym for `SESSION`.

* If no modifier is present, the default is `SESSION`.

 The scope for each status variable is listed at [Section 5.1.10, “Server Status Variables”](server-status-variables.html).

 Each invocation of the [`SHOW STATUS`](show-status.html) statement uses an internal temporary table and increments the global [`Created_tmp_tables`](server-status-variables.html#statvar_Created_tmp_tables) value.

 Partial output is shown here. The list of names and values may differ for your server. The meaning of each variable is given in [Section 5.1.10, “Server Status Variables”](server-status-variables.html).

```
mysql> SHOW STATUS;
+--------------------------+------------+
| Variable_name            | Value      |
+--------------------------+------------+
| Aborted_clients          | 0          |
| Aborted_connects         | 0          |
| Bytes_received           | 155372598  |
| Bytes_sent               | 1176560426 |
| Connections              | 30023      |
| Created_tmp_disk_tables  | 0          |
| Created_tmp_tables       | 8340       |
| Created_tmp_files        | 60         |
...
| Open_tables              | 1          |
| Open_files               | 2          |
| Open_streams             | 0          |
| Opened_tables            | 44600      |
| Questions                | 2026873    |
...
| Table_locks_immediate    | 1920382    |
| Table_locks_waited       | 0          |
| Threads_cached           | 0          |
| Threads_created          | 30022      |
| Threads_connected        | 1          |
| Threads_running          | 1          |
| Uptime                   | 80380      |
+--------------------------+------------+
```

 With a [`LIKE`](string-comparison-functions.html#operator_like) clause, the statement displays only rows for those variables with names that match the pattern:

```
mysql> SHOW STATUS LIKE 'Key%';
+--------------------+----------+
| Variable_name      | Value    |
+--------------------+----------+
| Key_blocks_used    | 14955    |
| Key_read_requests  | 96854827 |
| Key_reads          | 162040   |
| Key_write_requests | 7589728  |
| Key_writes         | 3813196  |
+--------------------+----------+
```

