MySQL Forums
Forum List  »  NDB clusters

Hacked Up Args for ndb_size.pl
Posted by: Mike Kruckenberg
Date: November 27, 2006 11:23PM

No idea if this is interesting to anyone, but thought I'd throw it out there. The short story (longer story follows) is that I hacked up ndb_size.pl a bit to work the way I want it, with optional, named parameters, instead of required positional arguments.

Current usage:
ndb_size.pl database hostname user password

Post-hack usage:
ndb_size.pl --database=<db name> [--hostname=<host>] [--user=<user>] [--password=<password>] [--template=<path/file>] [--help|-h]

--hostname=<host>:<port> can be used to designate a specific port
--hostname defaults to 127.0.0.1
--user and --password default to empty string
--template defaults to ndb_size.tmpl in the current directory


The longer story is that I've been using ndb_size.pl to do some calculations on a database that's coming from pre-NDB MySQL installation. To do work with the size I dumped and then loaded the data into MyISAM tables on a spare, fresh box to run ndb_size.pl.

I ended up in the code because ndb_size.pl was failing on finding the ndb_size.tmpl file and I didn't have a clue where it wanted the template file to be. I guess my Perl fingers took over somewhere there because before I knew it some other things I wanted were there; namely the ability to run ndb_size.pl on the local machine (no hostname) using the *insecure* account (no username or password).

I can make a patch if anyone else is interested - it uses the GetOpt package (included with Perl distro) to process the params, supports shortcuts etc.

If not, it was still worth it to spend a lot more time than really necessary to have it work the way I like it.

Mike Kruckenberg
Co-author of Pro MySQL (Apress)
http://mike.kruckenberg.com

Options: ReplyQuote


Subject
Views
Written By
Posted
Hacked Up Args for ndb_size.pl
1779
November 27, 2006 11:23PM
1069
November 28, 2006 04:37AM
1014
November 28, 2006 06:23AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.