MySQL in Anwendung

Aus Primatenwiki
Version vom 8. Januar 2025, 18:21 Uhr von Rbritt (Diskussion | Beiträge) (Die Seite wurde neu angelegt: «== Tabellengrösse in MB ausgeben == <source lang="sql"> SELECT table_schema as `Database`, table_name AS `Table`, round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` FROM information_schema.TABLES ORDER BY (data_length + index_length) DESC; </source> == Alle Tabellen ausgeben == <source lang="sql"> SELECT table_schema as `Database`, table_name AS `Table` FROM information_schema.TABLES WHERE table_schema not…»)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

Tabellengrösse in MB ausgeben

<source lang="sql"> SELECT

    table_schema as `Database`, 
    table_name AS `Table`, 
    round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` 

FROM information_schema.TABLES ORDER BY (data_length + index_length) DESC; </source>

Alle Tabellen ausgeben

<source lang="sql"> SELECT

    table_schema as `Database`, 
    table_name AS `Table`

FROM information_schema.TABLES WHERE table_schema not like "perform%" AND table_schema not like "inform%" AND table_schema not like "sys" AND table_schema not like "mysql" ORDER BY table_schema, table_name; </source>