Kaedah kapasiti pangkalan data pertanyaan mysql: 1. Buka tetingkap DOS, dan kemudian masukkan direktori bin mysql 2. Jalankan "SELECT table_schema AS 'shujuku', table_name AS 'biaoming', table_rows AS 'jilushu'; , TRUNCATE (data_length / 1024 / 1024, 2) ..." pernyataan boleh digunakan untuk melihat kapasiti setiap jadual dalam semua pangkalan data.
Persekitaran pengendalian tutorial ini: sistem Windows 10, MySQL versi 5.7, komputer Dell G3.
Bagaimana untuk menanyakan kapasiti pangkalan data dalam mysql?
MySql Lihat pangkalan data dan kapasiti jadual dan isih
MySql Lihat pangkalan data dan kapasiti jadual dan isih Lihat semua kapasiti pangkalan data
SELECT table_schema AS '数据库', sum(table_rows) AS '记录数', sum( TRUNCATE (data_length / 1024 / 1024, 2) ) AS '数据容量(MB)', sum( TRUNCATE (index_length / 1024 / 1024, 2) ) AS '索引容量(MB)' FROM information_schema. TABLES GROUP BY table_schema ORDER BY sum(data_length) DESC, sum(index_length) DESC;
Lihat semua jadual pangkalan data Kapasiti
SELECT table_schema AS '数据库', table_name AS '表名', table_rows AS '记录数', TRUNCATE (data_length / 1024 / 1024, 2) AS '数据容量(MB)', TRUNCATE (index_length / 1024 / 1024, 2) AS '索引容量(MB)' FROM information_schema. TABLES ORDER BY data_length DESC, index_length DESC;
Lihat kapasiti pangkalan data yang ditentukan
SELECT table_schema AS '数据库', sum(table_rows) AS '记录数', sum( TRUNCATE (data_length / 1024 / 1024, 2) ) AS '数据容量(MB)', sum( TRUNCATE (index_length / 1024 / 1024, 2) ) AS '索引容量(MB)' FROM information_schema.tables where table_schema = 'your_table_name';
Lihat kapasiti setiap jadual pangkalan data yang ditentukan
SELECT table_schema AS '数据库', table_name AS '表名', table_rows AS '记录数', TRUNCATE ( data_length / 1024 / 1024, 2 ) AS '数据容量(MB)', TRUNCATE ( index_length / 1024 / 1024, 2 ) AS '索引容量(MB)' FROM information_schema.TABLES WHERE table_schema = '指定的库名' ORDER BY data_length DESC, index_length DESC;
Pembelajaran yang disyorkan: " Tutorial video MySQL》
Atas ialah kandungan terperinci Bagaimana untuk menanya kapasiti pangkalan data dalam mysql. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!