#!/bin/bash
 
if [[ $# -ne 1 ]]; then
  echo "Usage: $0 <mysql db dump>"
  exit 1
elif [[ ! -f $1 ]]; then
  echo "File not found: $1"
  exit 1
fi
 
# remove MySQL DEFINER statements from mysql db dump
perl -p -i -e "s/DEFINER=\`\w.*\`@\`localhost\`//g" $1