Software Development

How to determine the current size of a MySQL Database

Background

[wp_ad_camp_1]

Sometimes you may need to limit the size of a particular MySQL specially for demo applications. Limiting the size of a database requires determining its current size before any insert operation. This article demonstrates how to use SQL to retrieve the current database size.

Software Environment

  • Windows 7 Professional SP1
  • MySQL 5.6.16 – Community Server (GPL)

The SQL Select Statement

The SQL statement below retrieves the needed data from information_schema.TABLES table. You database user must have priviledge to run queries against the table in information_schema.

[wp_ad_camp_5]

Sample Output

mysql_db_current_size

[wp_ad_camp_2]

Loading

Got comments or suggestions? We disabled the comments on this site to fight off spammers, but you can still contact us via our Facebook page!.


You Might Also Like