Find databases (schemas) containing a particular table on MariaDB server

Rene Castro - Dataedo Team Rene Castro 2019-01-15

Table of Contents:


    The query below finds all databases (schemas) containing a particular table.

    Query

    select table_schema as database_name
    from information_schema.tables 
    where table_type = 'base table'
        and table_name = 'your table name'
    order by table_schema;
    

    Columns

    • database_name - database (schema) name

    Rows

    • One row: represents one database (schema)
    • Scope of rows: all databases (schemas) containing the specified table name
    • Ordered by: database (schema) name

    Sample results

    The screen below shows all the databases (schemas) that contain the customer table.

    0
    There are no comments. Click here to write the first comment.

    By continuing to use our website, you consent to the use of cookies in accordance with our Privacy Policy (updated 28-04-2020).
    Accept