×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Dmitriy Lanets
Added: Mar 28, 2017 12:47 PM
Modified: Apr 7, 2017 7:20 AM
Views: 13
Tags: no tags
  1. SELECT  table_schema "database_name", TABLE_NAME, ( data_length + index_length )/1024/1024 "Database size in MB"
  2.   FROM information_schema. TABLES
  3.       WHERE TABLE_SCHEMA = "ar_29auto"
  4.       #GROUP BY TABLE_SCHEMA;
  5.  
  6. #или
  7. SEL ECT ceil(sum( data_length + index_length ) /1048576) 'dbsize' FR OM information_schema.TABLES where table_schema REGEXP '.*_kapot' AND NOT (table_name REGEXP '(_temp|_copy|_del_|^upload_session_[0-9]+)$')