How do you query the size of data in a table with MySQL? MySQLでテーブル内のデータサイズをクエリする方法は?

あなたは、テーブルのデータサイズを検索するために以下のMySQLステートメントを使用できます:

SELECT table_name AS "表名", 
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "数据大小(MB)"
FROM information_schema.tables
WHERE table_schema = 'your_database_name'
AND table_name = 'your_table_name';

your_database_nameとyour_table_nameをあなたのデータベース名とテーブル名に置き換えた後、このステートメントを実行すると、そのテーブルのデータサイズ(MB単位)が取得できます。

bannerAds