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 104 times
0

E_net4
- 27,810
- 13
- 101
- 139

Shawn Brar
- 1,346
- 3
- 17
-
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
2
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,672
- 8
- 47
- 91
-
1INFORMATION_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