SHOW TABLES returns the names of all base tables and views in the current or specified MariaDB database.
Execute SHOW TABLES;
in any SQL editor connected to MariaDB. The server returns one row per table or view in the current database.
Add FROM db_name
to the statement, e.g., SHOW TABLES FROM shop;
. This is useful when you are connected to a different database but need a quick inventory of shop
.
Use LIKE 'pattern'
for simple wildcards or WHERE
for boolean expressions. Example: SHOW TABLES LIKE 'cust%';
lists only tables whose names start with cust
.
SHOW FULL TABLES
adds a Table_type
column that tells whether each entry is a BASE TABLE
or a VIEW
. This helps when your schema mixes the two.
Combine SHOW TABLES
with the information_schema.user_privileges
view, or rely on GUI tools. SHOW TABLES itself only lists objects; it doesn’t check permissions.
SHOW TABLES
is shorter, cached, and optimized for quick listing. information_schema.tables
offers richer metadata but is slower and requires more typing.
Always qualify with FROM db_name
inside scripts to avoid surprises when the connection’s default database changes. Include FULL
when distinguishing views from tables matters.
You need at least the SELECT privilege on the database. Without it, the command returns an empty set.
SHOW TABLES doesn’t return counts. Query information_schema.tables or run SELECT COUNT(*) on each table.
SHOW TABLES lists only permanent tables. Temporary tables are visible only in the current session via information_schema.tables.