CentOS Debian Mint openSUSE Red Hat Ubuntu

List Tables in a MySQL Database

List Tables in a MySQL Database

Introduction

When working with MySQL databases, you usually have to list the database tables or perform some commands to retrieve the common information of DB as well.

This article will show you the way to list tables in the MySQL database by using the command line.

Show Tables in MySQL database

Firstly, you have to connect to the MySQL server by running the following command

$ mysql -u user -p

For example:

$ mysql -u karim -p

In the MySQL shell, let’s choose the database we will work on:

mysql> USE database-name;

In order to list all of the tables in the current chosen database, run the following command

mysql> SHOW tables;

If you want to list the tables with their type, run:

mysql> SHOW FULL tables;

Conclusion

You’ve already go through the details of how to get information of the tables in the MySQL database.

If you have any concerns, please let me know. Thank you for reading.

Similar Posts