SELECT table_name AS "Table", ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" FROM information_schema. SELECT TABLESCHEMA AS Database, TABLENAME AS Table, ROUND( (DATALENGTH + INDEXLENGTH) / 1024 / 1024) AS Size (MB) FROM informationschema.TABLES ORDER BY (DATALENGTH + INDEXLENGTH) DESC This will return not only the size of the table, but also the table name and parent database it is associated with. Suppose, we have a database named “ test” and we want to find the size of all the tables in that database, then the query to do so will be: The documentation window for a table shows an estimated row count, but I would also like to know the physical size of the table. Here, we need to replace “ database_name” with the name of the database whose table’s size we are going to find. We will also learn how to filter results using LIKE and WHERE clauses: This command is used to list down the databases available on a MySQL server. However the database grew to 1.04 GB while my hosting server limit for databases is. MaIn this tutorial, we will learn about syntax and usage of MySQL SHOW DATABASES command with programming examples. SELECT table_name AS "Table", ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" FROM information_schema.TABLES WHERE table_schema = "database_name" ORDER BY (data_length + index_length) DESC Hi, I am using SuiteCRM for more than a year now and it serves me well. Get size (in MB) of all tables of a particular database The result will be displayed something like below: Database Name SELECT table_schema "Database Name", sum( data_length + index_length ) / 1024 / 1024 "Database Size in MB" FROM information_schema.TABLES GROUP BY table_schema How to reduce database size Open the MySQL Databases section and repair your database Delete any unused content on your website Delete any SPAM comments. ![]() It also shows the query to get the size (in MB) of all the tables present in any particular database. This article shows SQL query to get size (in MB) of all MySQL databases. Facebook Tweet LinkedIn Pin Print Email Shares
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |