mysql查看数据库和表使用空间

– 1.切换

USE information_schema;

– 2.查看数据库使用大小

SELECT
	concat(
		round(
			sum(data_length / 1024 / 1024),
			2
		),
		'MB'
	) AS DATA
FROM
	TABLES
WHERE
	table_schema = 'user_server';

– 3.查看表使用大小

SELECT
	concat(
		round(
			sum(data_length / 1024 / 1024),
			2
		),
		'MB'
	) AS DATA
FROM
	TABLES
WHERE
	table_schema = 'user_server'
AND table_name = 'log_info';
已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 鲸 设计师:meimeiellie 返回首页