mysql.rst
changeset 1877 7627e51556bf
parent 1876 653a83760554
child 1878 25c0fb1dfc22
equal deleted inserted replaced
1876:653a83760554 1877:7627e51556bf
    58   MariaDB [mysql]> SHOW CREATE DATABASE mysql;
    58   MariaDB [mysql]> SHOW CREATE DATABASE mysql;
    59   MariaDB [mysql]> SHOW CREATE TABLE user;
    59   MariaDB [mysql]> SHOW CREATE TABLE user;
    60 
    60 
    61   MariaDB [mysql]> SHOW GRANTS;
    61   MariaDB [mysql]> SHOW GRANTS;
    62 
    62 
    63 Table sizes::
    63 Table/index sizes.
       
    64 ==================
       
    65 ::
    64 
    66 
    65   MariaDB [mysql]> SHOW TABLE STATUS FROM mydb;
    67   MariaDB [mysql]> SHOW TABLE STATUS FROM mydb;
       
    68 
       
    69   SELECT
       
    70      table_schema as `Database`,
       
    71      table_name AS `Table`,
       
    72      round(((data_length + index_length) / 1024 / 1024), 2) `Size, MiB`
       
    73   FROM information_schema.TABLES
       
    74   ORDER BY (data_length + index_length) DESC;
       
    75 
       
    76   SELECT
       
    77      table_schema as `Database`,
       
    78      table_name AS `Table`,
       
    79      round((data_length / 1024 / 1024), 2) `Data, MiB`,
       
    80      round((index_length / 1024 / 1024), 2) `Index, MiB`,
       
    81      round(((data_length+index_length) / 1024 / 1024), 2) `Total, MiB`
       
    82   FROM information_schema.TABLES
       
    83   ORDER BY (data_length + index_length) DESC;
    66 
    84 
    67 System information.
    85 System information.
    68 ===================
    86 ===================
    69 
    87 
    70 Server version, platform, etc::
    88 Server version, platform, etc::