Select data from "show tables" MySQL query

BioTronic picture BioTronic · Sep 15, 2008 · Viewed 171.1k times · Source

Is it possible to select from show tables in MySQL?

SELECT * FROM (SHOW TABLES) AS `my_tables`

Something along these lines, though the above does not work (on 5.0.51a, at least).

Answer

Andrew picture Andrew · Sep 15, 2008

I think you want SELECT * FROM INFORMATION_SCHEMA.TABLES

See http://dev.mysql.com/doc/refman/5.0/en/tables-table.html