I was tired to get manually disk space used for all MySQL
databases, I just created a stored procedure to get an overview
of the database sizes in our MySQL server.
MySQL don’t have a command that allows us an overall summary of
the databases, something like SHOW TABLE STATUS for databases.
The “SHOW DATABASES” command lists only the current databases
without any other information like how many space are using or
how many tables there are, etc.
The procedure that I wrote this based on INFORMATION_SCHEMA
database, which contains rich information of all existing
databases.
I suggest, in a previous post, place all these procedures in a
database called tools, but you can still choose different
location.
So when call the procedure will have a global view of information
that will be useful for maintenance tasks.
mysql> call tools.sp_overview(); …
[Read more]