Created
March 24, 2020 11:39
-
-
Save nickdotht/2e1020b57fca4b999b9ba1f3705f508b to your computer and use it in GitHub Desktop.
Commands to dump a MySQL DB without the definer.
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
mysqldump -h [DB-HOST] --databases [DB-NAME] -u[DB-USER] -p | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' > ./[OUTPUT-FILE-NAME].sql |
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
mysqldump --no-data --single-transaction=true -h[DB-HOST] -u[DB-USER] -p --databases [DB-NAME] | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' > [OUTPUT-FILE-NAME].sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment