Skip to content

Instantly share code, notes, and snippets.

@breenie
Last active August 9, 2016 10:22
Show Gist options
  • Select an option

  • Save breenie/e3fa2d5f86453e948b1e87e090b0842f to your computer and use it in GitHub Desktop.

Select an option

Save breenie/e3fa2d5f86453e948b1e87e090b0842f to your computer and use it in GitHub Desktop.
Strip MySQL definer from dump files
#!/bin/sh
# Strip deinfers in comments
sed -ie 's/\/\*[^*]*DEFINER=[^*]*\*\///' path/to/file.sql
# Strip all definers
sed -i 's/DEFINER=`[^`]*`@`[^`]*`//' path/to/file.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment