You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

If you need to determine how much data a MySQL database is consuming, use the information_schema database and run the following command:\n
\n
mysql> use information_schema;\n
mysql> select table_schema, sum(data_length)/1024/1024 from tables group by table_schema;\n
\n
+----------------------------+-----------------------------------------+\n
| table_schema | sum(data_length)/1024/1024 |\n
+----------------------------+-----------------------------------------+\n
| information_schema | 0.00000000 |\n
| mysql | 0.41797256 |\n
| uptime | 4031.60937500 |\n
+----------------------------+-----------------------------------------+\n
3 rows in set (1.04 sec)\n
\n
In the example above, up.time is using ~ 4.03 GB. Note that this does not necessarily mean that the MySQL database file is 4.03 GB as it is generally much larger.
  • No labels