Use this script to find a string in the whole database just change the few string values below to the appropriate
#!/usr/bin/perl -w
use DBI;
#showing the tables
$database = "###";
$username = "###";
$password = "####";
$hostname = "####";
$db = DBI -> connect("DBI:mysql:$database:$hostname", $username, $password);
#find tables
$query = $db->prepare("show tables");
$query -> execute;
#number of rows in the result
#$numrows = $query->rows;
while(@taken = $query->fetchrow_array){
print $taken[0];
print "\n";
$query2 = $db->prepare("desc $taken[0]");
$query2->execute;
while(@column = $query2->fetchrow_array){
$query3= $db->prepare("select * from $taken[0] where $column[0] like '%ehsdhb%' ");
$query3->execute;
@niroshan = $query3->fetchrow_array;
$numrows=$query3->rows;
if($numrows == 0){
print "no result";
print "\n";
}else{
print @niroshan;
#print "\n";
}}}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment