mySQL / MariaDB - List the tables in a database using the show tables command

by
Jeremy Canfield |
Updated: March 17 2022
| mySQL / MariaDB articles
The show tables command can be used to list the tables in a database. You will first need to log into your MariaDB or mySQL server or configure passwordless authentication and then use the -e command line option.
One option is to first use the use <database name> command and then issue the show tables command. In this example, the database named db001 will be used.
use db001; show tables;
Something like this should be returned.
+------------------+
| Tables_in_db001 |
+------------------+
| table001 |
| table002 |
| table003 |
+------------------+
Or, the "use <database name>" command can often be ignored by including the database name in the show tables command.
show db001.tables;
Did you find this article helpful?
If so, consider buying me a coffee over at