MariaDB Table Space Show Query SELECT table_schema, SUM(data_length+index_length) as Byte FROM information_schema.tables GROUP BY table_schema ORDER BY Byte DESC Using pymysql import pymysql conn = pymysql.connect(host=' ', port= , user=' ', password=' ', db=' ',charset='utf8') c = conn.cursor() sql = ''' SELECT table_schema, SUM(data_length+index_length) as Byte FROM information_schema.tables G..