Código
#!usr/bin/perl #Mysql Manager (C) Doddy Hackman 2011 #ppm install http://www.bribes.org/perl/ppm/DBI.ppd use DBI; sub head { } sub copyright { } sub sintax { } head(); unless (@ARGV > 2) { sintax(); } else { enter($ARGV[0],$ARGV[1],$ARGV[2]); } copyright(); sub enter { $info = "dbi:mysql::".$_[0].":3306"; if (my $enter = DBI->connect($info,$_[1],$_[2],{PrintError=>0})) { while(1) { if ($ac eq "exit") { $enter->disconnect; copyright(); } $re = $enter->prepare($ac); $re->execute(); my $total = $re->rows(); my @columnas = @{$re->{NAME}}; if ($total eq "-1") { next; } else { if ($total eq 0) { } else { for(@columnas) { } while (@row = $re->fetchrow_array) { for(@row) { } }}}} } else { }} # ¿ The End ?
Un ejemplo de uso
Código:
C:\Documents and Settings\Administrador\Escritorio\Todo\Warfactory II\proyectos\
mysqlman>manager.PL localhost root ""
-- == Mysql Manager == --
[+] Connecting to the server
[+] Enter in the database
[+] Query : show databases
[+] Result of the query
[+] Rows returned : 6
Database
information_schema
cdcol
hackman
mysql
phpmyadmin
test
[+] Query : exit
[+] Closing connection
-- == (C) Doddy Hackman 2011 == --