Skip to content

Instantly share code, notes, and snippets.

@bfgits
Created June 14, 2019 03:06
Show Gist options
  • Save bfgits/6fc489b33715dde7c87fdb11c7398c39 to your computer and use it in GitHub Desktop.
Save bfgits/6fc489b33715dde7c87fdb11c7398c39 to your computer and use it in GitHub Desktop.
how to check database size in mysql
SELECT
table_schema 'Database Name',
SUM(data_length + index_length) 'Size in Bytes',
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) 'Size in MiB'
FROM information_schema.tables
GROUP BY table_schema;
@bfgits
Copy link
Author

bfgits commented Sep 13, 2021

select count(user), user,
host,
db
from information_schema.processlist group by user ;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment