Name

SHOW OPEN TABLES

Synopsis

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

Use this statement to display a list of tables that are open, i.e., that are 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. Here is an example of this 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 | 
+----------+--------------------+--------+-------------+

Get MySQL in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.