- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
List down all the Tables in a MySQL Database
152 Lectures 16 hours
87 Lectures 5.5 hours
Let us understand how to list down all the tables in a MySQL database −
Once a database is created, we can access and use a specific database, using the following query −
mysql> USE databaseName Database changed
The ‘USE’ statement doesn’t require a semi-colon. This is similar to the ‘QUIT’ statement. Even if semi-colon is used, it does no harm. We can create and use a database of our own, but before that, MySQL administrator’s permission is required.
The MySQL administrator can execute a command as shown below to provide permissions −
mysql> GRANT ALL ON tableName.* TO ‘your_mysql_name’@’your_client_host’;
Here, ‘your_mysql_name’ refers to the MySQL user name which is assigned to the user.
The ‘your_client_host’ refers to the host from which the user connected to the server.
The below query displays the tables in the database −
mysql> SHOW TABLES;
Note: If the database was newly created, it is obvious that there would be no tables in it. The above query would result in an ‘empty set’. One of the most important part is to decide the structure of the database, the tables that would be needed, the columns in every table and the relationship between these tables.
Once we decide what our database needs to contain, a proper name for it, and tables have been created with proper column names and row values, we can discuss what kind of manipulations can be performed with this database.
- Display all tables inside a MySQL database using Java?
- How to list down all the running queries in MySQL?
- Get record count for all tables in MySQL database?
- How to get the list of tables in default MySQL database?
- Get a list of non-empty tables in a particular MySQL database?
- Find a specific column in all the tables in a database?
- How to list all triggers in a MySQL database?
- How can I describe all tables in the database through a single statement in MySQL?
- How can we check the character set of all the tables in a particular MySQL database?
- While connecting to one MySQL database, how can I see the list of tables of other MySQL database?
- List of non-empty tables in all your MySQL databases?
- How to count the number of tables in a MySQL database?
- How can I display all databases in MySQL and for each database show all tables?
- How to show all the tables present in the database and server in MySQL using Python?
- Get all the tables from a MySQL database having a specific column, let’s say xyz?