Last active
August 9, 2016 10:22
-
-
Save breenie/e3fa2d5f86453e948b1e87e090b0842f to your computer and use it in GitHub Desktop.
Strip MySQL definer from dump files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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