How to check storage used by MySQL on linux

Note Statistics

Note Statistics

  • Viewed 141 times
Sat, 09/26/2020 - 10:53
  1. Connect to your server
  2. Execute the query select @@datadir;
  3. Once you have directory (e.g /var/lib/mysql on Ubuntu) you can check the disk usage using the du command.

Example:

sudo du -h  /var/lib/mysql

980K	/var/lib/mysql/db_one
1.1M	/var/lib/mysql/mysql
8.0K	/var/lib/mysql/someother_db
1.2M	/var/lib/mysql/another_db
212K	/var/lib/mysql/performance_schema
1.7G	/var/lib/mysql
Authored by
Tags