Shawn Brar
Shawn Brar

Reputation: 1420

List tables in all the databases

I have three databases in mysql. And I would like to list all the tables in each database. How can I achieve this?

Upvotes: 0

Views: 129

Answers (1)

Flash Thunder
Flash Thunder

Reputation: 12036

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;

Upvotes: 2

Related Questions