List tables in all databases on MariaDB server

Article for: SQL Server Teradata MySQL

The query below lists tables in all user databases (schemas) of a MariaDB Server instance. To list tables just from current database use this query.

Query

select table_schema,
    table_name
from information_schema.tables
where table_type = 'BASE TABLE'
    and table_schema not in ('information_schema','mysql',
                             'performance_schema','sys')
order by table_schema,
    table_name;

Columns

  • table_schema - name of the database (schema)
  • table_name - name of the table

Rows

  • One row: represents one table in a database (schema)
  • Scope of rows: tables in all databases (schemas)
  • Ordered by: database (schema) name, table name

Sample results

You could also get this

Get this interactive HTML data dictionary in minutes with Dataedo.

See live HTML data dictionary sample

Try for free

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
0
There are no comments. Click here to write the first comment.