I have three databases in mysql. And I would like to list all the tables in each database. How can I achieve this?
Asked
Active
Viewed 66 times
0
E_net4 - Krabbe mit Hüten
- 24,143
- 12
- 85
- 121
Shawn Brar
- 1,084
- 2
- 13
-
Does this answer your question? [Get table names using SELECT statement in MySQL](https://stackoverflow.com/questions/8334493/get-table-names-using-select-statement-in-mysql) – Nico Haase Jul 26 '21 at 08:46
1 Answers
1
select table_schema as database_name, table_name
from information_schema.tables
where table_type = 'BASE TABLE'
and table_schema not in ('information_schema','mysql',
'performance_schema','sys')
order by database_name, table_name;
Flash Thunder
- 11,114
- 7
- 42
- 84
-
INFORMATION_SCHEMA It is an ANSI standard set of views that is supported in many RDBMS as listed in this Wikipedia page: https://en.wikipedia.org/wiki/Information_schema – Chris Schaller Jul 25 '21 at 14:36