List top 10 largest MySQL databases in Linux

Run the following command as root to list the top 10 largest MySQL databases in Linux.

du -s /var/lib/mysql/* | sort -n| cut -f 2-|xargs -i du -sh {} |tail -10

You may need to change the directory to match your configuration. /var/lib/mysql is the default MySQL directory on a cPanel server.

Leave a Reply

Your email address will not be published. Required fields are marked *