
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How can we get the list of tables in a particular database from MySQL Server command line?
We need to use ‘mysqlshow’ client program along with the name of the database to get the list of tables in a particular database. Its syntax would be as follows −
Mysqlshow – u root db_name [pat_matching]
Here db_name would be the name of the database from which we want to get the name of tables.
Pat_matching is optional. It is used to get the list of the tables of some specific pattern. If we will not provide any pattern then it will show all the tables stored in that database.
Example
The following command will get all the tables of database ‘query’ −
C:\mysql\bin>mysqlshow -u root query Database: query +---------------------+ | Tables | +---------------------+ | cars | | cars_avgprice | | customers | | detail_bday | | emp | | emp123 | | emp_t | | examination_btech | | first_view | | info | | item_list | | item_list1 | | new_number | | reservation | | reservations | | reserve | | student | | student_detail | | student_info | | student_marks | | tender | | tender1 | | view_detail | | view_student_detail | | website | +---------------------+
Now, suppose if we want to get the tables that are having ‘student’ in its name then following query with pattern matching can be used −
C:\mysql\bin>mysqlshow -u root query %student% Database: query Wildcard: %student% +---------------------+ | Tables | +---------------------+ | student | | student_detail | | student_info | | student_marks | | view_student_detail | +---------------------+
- Related Articles
- How can we analyze the tables of a particular database from MySQL Server command line?
- Get a list of non-empty tables in a particular MySQL database?
- How can we check the character set of all the tables in a particular MySQL database?
- How can we see the list of views stored in a particular MySQL database?
- How can we see only the list of stored procedures in a particular MySQL database?
- How can we see only the list of stored functions in a particular MySQL database?
- How to repair MySQL tables from the command line?
- How to upgrade MySQL server from command line?
- How Can I check the size of the tables in a particular MySQL database?
- How can we get the list of MySQL server-side help categories?
- How to get the list of tables in default MySQL database?
- How can we see MySQL temporary tables in the list of tables?
- How can we see the list of stored procedures and stored functions in a particular MySQL database?
- How can I check MySQL tables from a database in accordance with particular\ncolumn/s name?
- How can we return to windows command shell from MySQL command line tool?

Advertisements