SHOW OPEN TABLES

Use this MySQL statement to display a list of tables that are open; that is to say, in the table cache. The list does not include any temporary tables.

Syntax

Below is the syntax for this command. Text within square brackets (i.e, [ and ] ) are optional. Choices are separated by bars (i.e, | ). Ellipses preceded by a comma indicates a repeating pattern. Ellipses before or after syntax are used to highlight a relevant except from the larger syntax. Text displayed in italic letters represent text that should be replaced with the specific names related to the database (e.g., column with the name of the column).

SHOW OPEN TABLES [FROM database] [LIKE 'pattern'|WHERE expression]

Explanation

Use this MySQL statement to display a list of MySQL tables that are open; that is to say, in the table cache. The list does not include any temporary tables. The LIKE clause can be used to limit the tables displayed by a naming pattern. Similarly, the WHERE clause may be used to refine the results set.

Examples

Below is an example of this MySQL statement:

SHOW OPEN TABLES 
FROM college LIKE '%student%';
 
+----------+--------------------+--------+-------------+
| Database | Table              | In_use | Name_locked |
+----------+--------------------+--------+-------------+
| college  | student_surveys    |      0 |           0 | 
| college  | students           |      0 |           0 | 
| college  | student_exams      |      0 |           0 | 
| college  | student_exams_past |      0 |           0 | 
+----------+--------------------+--------+-------------+