Monthly Archives: September 2011

You are browsing the site archives by month.

Perl script for checking MySQL database disk space usage (in GB)

Perl script for checking MySQL database disk space usage (in GB) #!/usr/bin/perl # database size verification use DBI; use Getopt::Long; #Commandline arguments #my @cmdline = @ARGV; #my $counts =@cmdline; sub usage { print STDERR @_, “n” if @_; die <<EOF; Usage: [ options ] Options: -?,  –help             show this help -h,  –host=…         connect to host Continue Reading

Clear command doesn't work for clear the screen in MySQL

I was very much confused when I have tried to clear the screen of MySQL and I didn’t got any result. root@nilnandan-Satellite-A200:~# mysql -uroot -p Enter password: Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the current input statement. mysql> show databases; +——————–+ | Database           | +——————–+ | information_schema | | mysql              | Continue Reading

How FLUSH TABLES works in MySQL

“FLUSH TABLES” is generally used for closing all tables by force in MySQL. Its really interesting that how mysql do this. Most of time we are doing this because someone adds new tables outside of MySQL. (Like for MyISAM tables, we are copying .FRM, .MYD and .MYI files. We can do this when MySQL is Continue Reading

How caches used in MySQL

Following caches are generally available in MySQL. Key Cache This is a shared cache for all B-tree index blocks which are in different MYI files. Internally, this cache is using hashing and reverse linked lists algorithm for quick caching for most recently used blocks and flushed the blocks which are not recently used or some Continue Reading