How to use MySQL In MySQL
If you’re using the MySQL Shell, you can run the following command:
SHOW TABLE STATUS LIKE ‘DB NAME’;
Example:
SHOW TABLE STATUS LIKE 'student';
- SHOW TABLE STATUS: query tells MySQL to display information about tables.
- LIKE ‘DB NAME’: The LIKE statement is utilized to screen search outcomes using particular patterns. It can be used to filter tables that correspond with the designated database name by utilizing ‘DB NAME’. Simply replace it with the real name of the database you plan on examining.
Output:
Explanation:
This command will display detailed information about each table in the specified database, including the data length and index length.
The result will provide information about all the table in the specified database, details such as the table name, engine, version, row count, data length, index length, etc.
Please Note that the output of this query can be very Large, so you might want to focus on the particular columns that are most relevant according to your need.
How to Check MySQL Database
SQL stands for Structured Query Language which is a computer language for storing, manipulating, and retrieving data stored in relational database management systems (RDBMS). SQL was developed at IBM by Donald Chamberlin, Donald C. Messerli, and Raymond F. Boyce in the year 1970s. MySQL is an open-source Relational Database Management System that stores data in a structured format using rows and columns. MYSQL language is easy to use as compared to other programming languages like C, C++, Java, etc. By learning some basic commands we can work, create, and interact with the Database.
A table is used to organize data in the form of rows and columns and is used for both storing and displaying records in the structure format. It is similar to worksheets in the spreadsheet application. A table creation command requires three things:
- Name of the table
- Names of fields
- Definitions for each field
MySQL allows us to create a table in the database mainly in two ways:
- MySQL Command Line Client
- MySQL Workbench
To get the size of a MySQL database, you can use various methods, including SQL queries or checking the file system. Here are a few ways to accomplish this: