Last active
April 15, 2020 10:17
-
-
Save arnisjuraga/a377c591bdddda17b00108beb0bad1ed to your computer and use it in GitHub Desktop.
Remove DEFINER from MySQL mysqldump tool backup file
This file contains 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
# | |
# Documented from https://stackoverflow.com/questions/9446783/remove-definer-clause-from-mysql-dumps | |
# | |
cat backupfile.sql | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' | sed -e 's/DEFINER[ ]*=[ ]*[^*]*PROCEDURE/PROCEDURE/' | sed -e 's/DEFINER[ ]*=[ ]*[^*]*FUNCTION/FUNCTION/' > result.sql | |
# | |
# | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://stackoverflow.com/questions/9446783/remove-definer-clause-from-mysql-dumps