• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to check database and table size in MariaDB

{{postValue.id}}

To check database and table size in MariaDB

MariaDB is a community developed fork of MySQL. It is designed to maintain high compatibility with MySQL. It includes the XtraDB feature for replacing the innoDB. In this tutorial we are going cover the topic on how to check database size and table size in Mariadb.

Checking the database and table size

To check the various database and table size in MariaDB check whether the MySQL is running or not. enter the mysql command to call the MariaDB.

[root@linuxhelp1 ~]# mysql
Welcome to the MariaDB monitor.  Commands end with   or g.
Your MariaDB connection id is 8
Server version: 5.5.52-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type ' help '  or ' h'  for help. Type ' c'  to clear the current input statement.
MariaDB [(none)]> 

After invoking the MariaDB in the terminal, enter the following command to check a particular database size.

MariaDB [(none)]>  SELECT table_schema " Database Name" , SUM( data_length + index_length)/1024/1024 " Database Size (MB)"  FROM information_schema.TABLES where table_schema = ' mysql'  
+---------------+--------------------+
| Database Name | Database Size (MB) |
+---------------+--------------------+
| mysql         |         0.62618065 |
+---------------+--------------------+
1 row in set (0.00 sec)

To check the size of all the database stored in MariaDB, enter the following command to check the size.

MariaDB [(none)]>  SELECT table_schema " Database Name" , SUM(data_length+index_length)/1024/1024 " Database Size (MB)"   FROM information_schema.TABLES GROUP BY table_schema 
+--------------------+--------------------+
| Database Name      | Database Size (MB) |
+--------------------+--------------------+
| information_schema |         0.07031250 |
| mysql              |         0.62618065 |
| performance_schema |         0.00000000 |
+--------------------+--------------------+
3 rows in set (0.01 sec)

After checking a particular database size, now you can check the particular table size from the database by entering the following command.

MariaDB [(none)]>  SELECT table_name " Table Name" , table_rows " Rows Count" , round(((data_length + index_length)/1024/1024),2) " Table Size (MB)"  FROM information_schema.TABLES WHERE table_schema = " mysql"  AND table_name =" user"  
+------------+------------+-----------------+
| Table Name | Rows Count | Table Size (MB) |
+------------+------------+-----------------+
| user       |          3 |            0.00 |
+------------+------------+-----------------+
1 row in set (0.00 sec)

To check all the table size from the databases enter the following command.

MariaDB [(none)]>  SELECT table_name " Table Name" , table_rows " Rows Count" , round(((data_length + index_length)/1024/1024),2) " Table Size (MB)"  FROM information_schema.TABLES WHERE table_schema = " mysql"  
+---------------------------+------------+-----------------+
| Table Name                | Rows Count | Table Size (MB) 
+---------------------------+------------+-----------------+
| columns_priv              |          0 |            0.00 |
| db                        |          0 |            0.01 |
| event                     |          0 |            0.00 |
| func                      |          0 |            0.00 |
| general_log               |          2 |            0.00 |
| help_category             |         39 |            0.00 |
| help_keyword              |        464 |            0.10 |
| help_relation             |       1028 |            0.03 |
| help_topic                |        508 |            0.45 |
| host                      |          0 |            0.00 |
| ndb_binlog_index          |          0 |            0.00 |

To quit from the MariaDB, enter the following command.

MariaDB [(none)]>  q
Bye

Tags:
gabriel
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What is the command to check mariadb version you have installed?

A

The command to check mariadb version you have installed by below command

# mysql -v

Q

How to check all the table size from the databases?

A

SELECT table_name "Table Name", table_rows "Rows Count", round(((data_length + index_length)/1024/1024),2)
"Table Size (MB)" FROM information_schema.TABLES WHERE table_schema = "mysql";

Q

How to quit from the mariadb?

A

To quit from the MariaDB, enter the following command.

MariaDB [(none)]> q

Q

What is the use of check database and table size in MariaDB?

A

MariaDB is a community developed fork of MySQL. It is designed to maintain high compatibility with MySQL. It includes the XtraDB feature for replacing the innoDB.

Q

What is the command to switch to mariadb?

A

Enter the MySQL command to call the MariaDB by following command

# mysql

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Sebastian ?
How to change non required to required field in SuiteCRM Custom/Default Modules

How to change not required to the required field in SuiteCRM Custom/Default Modules?

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.