Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Size of mysql database/tables with perl

by rnahi (Curate)
on Feb 04, 2006 at 16:51 UTC ( #527961=note: print w/replies, xml ) Need Help??


in reply to Size of mysql database/tables with perl

I am often in need of this info, and I usually resort to the one-liner way. Here is my personal recipe:

$ mysql dbname -e 'show table status' | \ perl -lane '$size += $F[6]+$F[8];END{print $size}'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://527961]
help
Chatterbox?
[Corion]: Heh. Perl heredocs are nasty - Filter::Simple doesn't know whether the line continued after the heredoc or not. The heredoc payload starts on the next line.
[Corion]: So currently, Filter::Simple mangles your code/line numbers if you use heredocs ;)

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2017-01-22 10:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (187 votes). Check out past polls.