How to Check Database Size in MySQL

Method 1 of 2:

Using MySQL Workbench

  1. How to Check Database Size in MySQL Picture 1
    Open MySQL Workbench. It has a blue icon that with an image that resembles a dolphin. Click the icon to launch MySQL Workbench.
  2. How to Check Database Size in MySQL Picture 2
    Connect to the MySQL server. Double-click the MySQL server on under the SQL Development module in the start-up screen. Then enter the database password to connect. [1]
    1. If SQL server is not listed on this screen, click New Connection and enter the server information, including hostname, port, username, and password.
  3. How to Check Database Size in MySQL Picture 3
    Hover over the database in the schema pane. It's in the sidebar to the left. This displays a couple of icons to the right of the database name.
  4. How to Check Database Size in MySQL Picture 4
    Click the information icon. It's the icon that resembles an "i" next to the database name in the schema pane.
  5. How to Check Database Size in MySQL Picture 5
    Click the Info tab. It's the first tab in the main pane in the center. This displays information about the database. The database size is listed next to "Database size (rough estimate). this displays a rough estimate of the size of the database. [2]
Method 2 of 2:

Running a Query

  1. How to Check Database Size in MySQL Picture 6
    Connect to a MySQL server. There are a number of apps you can use to connect to a MySQL database, including MySQL Workbench. You can also query a MySQL database in the command line in Windows, or terminal on Mac. Once MySQL is installed on your computer you'll need to navigate to the MySQL directory in the Windows command line and type mysql -u root -p. Then enter the password for your database.
  2. How to Check Database Size in MySQL Picture 7
    Type SELECT table_schema "DB Name", as the first line of your query. This is the select command to query run a query on the database.
  3. How to Check Database Size in MySQL Picture 8
    Type SUM(data length + table length) 'Size in bytes', as the second line. This command will display the size of each table in bytes.
  4. How to Check Database Size in MySQL Picture 9
    Type ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) 'Size in MiB' as the next line. This displays a rounded number of the size in megabytes.
    1. To display a rounded number in kilobytes, type ROUND(SUM(data_length + index_length) / 1024, 2) 'Size in KiB' instead.[3]
  5. How to Check Database Size in MySQL Picture 10
    Type FROM information_schema.tables as the last line. This command specifies which database tables to query.
  6. How to Check Database Size in MySQL Picture 11
    Type GROUP BY table_schema; and execute the query. This will display the size of your databases. You can also type {[kbd|WHERE table_schema = 'database name';}} to check the size of a specific database. Type the actual name of the database in place of "database name". Your query should look something like this:
     SELECT table_schema "DB Name" SUM(data length + table length) 'Size in bytes', ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) 'Size in MiB' FROM information_schema.tables GROUP BY table_schema; 
5 ★ | 1 Vote

May be interested

  • How to Learn PHP and MySQLHow to Learn PHP and MySQL
    php is one of the most widely-used programming languages on the internet, and it allows you to do much more than simple html. mysql allows you to easily create and modify databases on your server. used together, these tools can create...
  • How to install MySQL Workbench Community Edition on Windows 10How to install MySQL Workbench Community Edition on Windows 10
    detailed instructions on how to install mysql workbench community edition on windows 10 to manage operations with mysql database management system more easily ..
  • Oracle improves MySQL on WindowsOracle improves MySQL on Windows
    oracle has updated the commercial version of mysql database for windows, added a graphical installer and the ability to perform failover clustering, ...
  • Guide to creating Virtual Hosting with PureFTPd and MySQLGuide to creating Virtual Hosting with PureFTPd and MySQL
    in the following article, tipsmake.com will show you how to install the pureftpd server using virtual user accounts from mysql's database, all inside the real system.
  • MySQL vulnerabilities allow malicious servers to steal data from customersMySQL vulnerabilities allow malicious servers to steal data from customers
    someone can take advantage of this problem to steal sensitive data from an improperly configured web server, allowing connection to untrusted servers or from database management applications. .
  • How to Create a Table in MySQLHow to Create a Table in MySQL
    tables make up the structure of your mysql databases. tables contain the information that is entered into the database, and can be created to suit basically any data storage need. creating a table only takes a few minutes, especially if...
  • Compare the performance of MongoDB and SQL Server 2008Compare the performance of MongoDB and SQL Server 2008
    in the following article, we will point out the difference in performance of the relatively new database management system, which is mongodb and one of the popular systems like sql server (mysql or oracle). most of the data is given here in the form of charts, so we can easily imagine the advantages and disadvantages of mongodb as well as other database management systems.
  • Steps to Import data from different tables in MySQL WorkbenchSteps to Import data from different tables in MySQL Workbench
    instructions on how to export and import data from different tables in a mysql database through the mysql workbench tool
  • How to Send Sql Queries to Mysql from the Command LineHow to Send Sql Queries to Mysql from the Command Line
    a simple text-based program called mysql should have been part of your mysql installation. it lets you send sql queries directly to the mysql server and output the results in text format. it is a quick and easy way to test your mysql...
  • How to Install the MySQL Database Server on Your Windows PCHow to Install the MySQL Database Server on Your Windows PC
    this wikihow teaches you how to install the mysql server program on a windows 10 computer. in order to install mysql on a windows computer, you must first have python 2.7 (not python 3+) installed. open the python download page. go to...