]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/list_mysql_databases
added list_mysql_databases
[biopieces.git] / bp_bin / list_mysql_databases
diff --git a/bp_bin/list_mysql_databases b/bp_bin/list_mysql_databases
new file mode 100755 (executable)
index 0000000..5c34482
--- /dev/null
@@ -0,0 +1,74 @@
+#!/usr/bin/env perl
+
+# Copyright (C) 2007-2009 Martin A. Hansen.
+
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# http://www.gnu.org/copyleft/gpl.html
+
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DESCRIPTION <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+# Display all MySQL databases.
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+
+use warnings;
+use strict;
+use Maasha::Common;
+use Maasha::Biopieces;
+use Maasha::SQL;
+
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+
+my ( $options, $user, $password, @databases, $database );
+
+$user     = $ENV{ "USER" };
+$password = $ENV{ "USER" };
+
+$options = Maasha::Biopieces::parse_options(
+    [
+        { long => 'user',     short => 'i', type => 'string', mandatory => 'no', default => $user,     allowed => undef, disallowed => undef },
+        { long => 'password', short => 'n', type => 'string', mandatory => 'no', default => $password, allowed => undef, disallowed => undef },
+    ]   
+);
+
+@databases = Maasha::SQL::list_databases( $options->{ 'user' }, $options->{ 'password' } );
+
+map { Maasha::Biopieces::put_record( { 'DATABASE' => $_ } ) } @databases;
+
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+
+BEGIN
+{
+    Maasha::Biopieces::status_set();
+}
+
+
+END
+{
+    Maasha::Biopieces::status_log();
+}
+
+
+# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+
+__END__