Skip to content

Instantly share code, notes, and snippets.

@paramah
Created January 3, 2012 12:09
Show Gist options
  • Save paramah/1554697 to your computer and use it in GitHub Desktop.
Save paramah/1554697 to your computer and use it in GitHub Desktop.
Clear DEFINER in MySQL Dumpfile
#!/usr/bin/perl
use strict;
use warnings;
while (my $line = <STDIN>) {
if($line =~ /^(\S+)\s*DEFINER\s{0,1}=\s{0,1}(\S+)(.*)/){
print $1." ".$3."\n";
}else{
print $line;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment