View Sizes of MySQL Databases & Tables over SSH

Sometimes, your typical database GUI (such as phpMyAdmin) won’t be usable for managing really big databases and you’ll have to work directly on the command line (SSH) for this.

After connecting to your server, you need to log into mysql with something like the following (this could vary depending on your server OS and set up):-

You will then be prompted to enter your MySQL password which you must do.

To view a list of databases and their sizes, use the following:-

To view a list of tables in a database and sort them by size (highest first), use the following:-

Make sure you replace DATABASE_NAME with the name of the database you want to investigate.

Geoff Jackson

Geoff Jackson (more commonly known by his online pseudonym zigojacko) is the founder of Design Haven and The Clubnet Group which hosts numerous agencies including the most widely recognised of them, Clubnet Digital, a full service digital marketing and creative design/development agency. He also has a personal blog but it doesn't get updated as much as he'd like.

Sponsored Links...

Subscribe to Design Haven UK

Enter your email address to subscribe and receive our new posts by email.

Leave a Reply

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

%d bloggers like this: