

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 Questions & Answers
- 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?
- After connecting to MySQL server how can we select a database from command prompt?
- How can we check the character set of all the tables in a particular MySQL database?
- How to repair MySQL tables from the command line?
- How to upgrade MySQL server from command line?
- How can we see the list of views stored in a particular MySQL database?
- 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 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?
- Connecting to MySQL database from the command line?
- How can we see MySQL temporary tables in the list of tables?
- Connect to MySQL database from command line
- How to get the list of tables in default MySQL database?
Advertisements